I am using Arc3D
to draw arcs that represent angles (θ & ɸ) in a 3D technical drawing.
Each is further delineated by the translucent triangles bounding the angle. I'd prefer to confine the translucency to a region bound by the arc and the corner inside the arc. This corner point is the m
attribute in the following code.
{a, b, m} = {{1, 0, 0}, {-1, 1, 2}, {1, 1, 1}};
Arc3D[{a_, b_, m_}, n_ : 60, prim_ : Line] :=
Module[{\[Alpha], lab, axis, aarc, tm, alpha},
lab = m + Norm[a - m]*Normalize[b - m];
axis = (a - m)\[Cross](b - m);
aarc = (VectorAngle[a - m, b - m]);
tm = RotationMatrix[alpha, axis];
prim@Table[m + tm . (a - m), {alpha, 0, aarc, aarc/n}]]
Arc3DPolygon[{a_, b_, m_}, n_ : 60, prim_ : Polygon] :=
Module[
{\[Alpha], lab, axis, aarc, tm, alpha},
lab = m + Norm[a - m]*Normalize[b - m];
axis = (a - m)\[Cross](b - m);
aarc = (VectorAngle[a - m, b - m]);
tm = RotationMatrix[alpha, axis];
prim@Table[
m + tm . (a - m),
{alpha, 0, aarc, aarc/n}
]
]
arc = Graphics3D[{
Arc3D[{a, b, m}, 20]
}];
arcFilled = Graphics3D[{
Point[m], Opacity[.4], Arc3DPolygon[{a, b, m}, 20]
}];
GraphicsGrid[{{arc, arcFilled}}]
As seen, Arc3DPolygon
hacks the original Arc3D
module to replace the Line
with a Polygon
, producing this effect.
How should the Arc3DPolygon
module be changed to allow the addition of the m
point (on the upper right in the 2nd graphic), to form the region required? Or, more generally, how should this problem be approached?
Append[Table[..], point]
, though you may have to useInsert[]
ifTable[]
does something really weird. $\endgroup$