Message Boards Message Boards

Sphere found hiding in torus

Posted 1 year ago

In Mathematica 12, the line of code below plots a torus in Graphics3D[] using ResourceFunction["Torus"]. It was plotted with Opacity[.2]. I was very surprised to see a sphere inscribed in the torus at approximately $\phi = 3\pi/2$ where $\phi$ is the angle of the outer radius. I take it this is some artifact of the BSpline function used by the “Torus” resource. Is there a mathematical reason for it, and is there any way to get rid of the inner sphere?

Graphics3D[{Opacity[.2], ResourceFunction["Torus"][{0, 0, 0}, {20, 2}]},Boxed->False]

enter image description here

POSTED BY: Gary Palmer
2 Replies
Posted 1 year ago

CapForm[None] did the trick with no downside that I can see.

Graphics3D[{CapForm[None], Opacity[.2], ResourceFunction["Torus"][origin, {10, 1}]}]
POSTED BY: Gary Palmer
Posted 1 year ago

It looks like ResourceFunction["Torus"] is defined by creating a tube around a BSplineCurve. The default CapForm for Tube is "Round". So, I believe that what you are seeing is the overlap of the end caps of the tube. FWIW, in version 13 Torus is a built-in function, so no need for the ResourceFunction.

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract