I have this code which first is supposed to make random points, draw lines through the points and then make these lines radical axes of cylinders. I have two problems with my code. First, it only draws the upper half of cylinders. Second, the perspectives are really messed up, somehow twisted and uneven. For example, Show[a, ViewPoint -> Front, ImageSize -> Large, Boxed -> False]
should be looking from a perspective where xy-plane is completely straight (perpendicular to z axis) but thats not what is happening. Here is my code:
plane = InfinitePlane[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}}];
pts = RandomPoint[plane, 20, {{-10, 10}, {-10, 10}, {0, 0}}];
a = Graphics3D[{plane,
Cylinder[{#, # + {#[[2]], -#[[1]],
4 Sqrt[3] Sqrt[#[[1]]^2 + #[[2]]^2] + 7}}, 1/2] & /@ pts,
Red, InfiniteLine[#, {#[[2]], -#[[1]],
4 Sqrt[3] Sqrt[#[[1]]^2 + #[[2]]^2] + 7}] & /@ pts, Black,
Sphere[{0, 0, 0}, 0.3], Blue, Sphere[pts, .1]},
PlotRange -> {{-10, 10}, {-10, 10}, {-10, 10}}]
Show[a, ImageSize -> Large, Boxed -> False]
Show[a, ViewPoint -> Above, ImageSize -> Large, Boxed -> False]
Show[a, ViewPoint -> Front, ImageSize -> Large, Boxed -> False]
Show[a, ViewPoint -> {0, 0, \[Infinity]}, ImageSize -> Large,
Boxed -> False]
Show[a, ViewPoint -> {0, -\[Infinity], 0}, ImageSize -> Large,
Boxed -> False]
Any help would be appreciated. Thank you!
Cylinder[{# - {#[[2]], -#[[1]], 4 Sqrt[3] Sqrt[#[[1]]^2 + #[[2]]^2] + 7}, # + {#[[2]], -#[[1]], 4 Sqrt[3] Sqrt[#[[1]]^2 + #[[2]]^2] + 7}}, 1/2] & /@ pts
to have the cylinders extend belowplane
. $\endgroup$Function
andSlot
in the docs. $\endgroup$