Rectangular Torus Surface

A rectangular torus is a surface formed by rotating a rectangle about a displaced axis. The rotation about the displaced axis may be over a full 360 degrees; or just some subset of that angular range. See also the discussion of the Rectangular Torus Volume for modeling refractive solid torus shapes.
The rectangular torus surface is defined by 6 parameters:
| Parameter # | Description | Face Name | Face # |
| 1 | The outer radius of the torus, Rout. | All Faces | 0 |
| 2 | The inner radius of the torus, Rin. | All Faces | 0 |
| 3 | The start angle of the torus, θ1. | All Faces | 0 |
| 4 | The stop angle of the torus, θ2. | All Faces | 0 |
| 5 | The thickness of the torus, Ty. | All Faces | 0 |
The rectangle lies in the YZ plane with the center at x = 0, y = 0, z = (Rout+Rin)/2. This position of the rectangle corresponds to the rotation angle θ = 0. The angles of rotation are about the Y axis and must meet this condition:
0 ≤ θ1 ≤ θ2 ≤ 360
There is also the restriction that Rout > Rin > 0 and Ty > 0. The reference coordinate is the center of the axis of rotation. Face Numbers: All faces Face 0.
Next: