I would like to know whether it is possible to change part of the Style
of a line in a 3D plot, when the line is under a surface, so that it seems obstructed by the surface. Of course I can always work this out using some elementary geometry and ViewPoint
, but I want to know wether I can make this automatic.
Just to make things more clear, here is an example
graph1 = Show[
Plot3D[{0, 1}, {x, 0, 1}, {y, 0, 1}, BoxRatios -> 1,
PlotStyle -> {{Opacity[0.3], Red}, {Opacity[0.3], Blue}},
Mesh -> False],
Graphics3D[{{Thick, Line[{{1/2, 1/2, 0}, {1/2, 1/2, 1}}]}}]];
I would like to make, in the example above, the bit of the line that is seen under the plane z=1
to appear as a dashed line, but the remainder of the line should appear as a solid line.
I tried
ResourceFunction["Graphics3DSketch"][graph1]
but it did not work.
z=1
and I want the hidden part to appear as dashed. This will of course depend on theViewPoint
we set in the options inPlot3D
. $\endgroup$