This Demonstration shows a torus with a polygonal cross section.[more]
To get a better view of its inside, open up the meridional and longitudinal gaps.
The Serret–Frenet formulas (using Mathematica's built-in FrenetSerretSystem) are used to generate the parametric equation of the torus surface.[less]
The parametric equation of a circular torus with a polygonal cross section is obtained as follows.
The parametric of the ring circle with radius is:
The polar equation of a regular -gon with circumradius is:
Using the Mathematica function FrenetSerretSystem, we define the normal and binormal vectors and :
This gives the parametric equation of the elliptical torus:
with vertices and the circumradius of the cross-sectional polygon.
Expanded, with , this becomes: