Rectangular coil script

 From:  bemfarmer
8657.1 
_CoilRectangular is a simple script which creates a multi-Turn helix-like, "rounded rectangle" coil curve, based upon a 2D rounded rectangle with continuous z offset. The curve can also be considered to be a spring coil.
The coil turn is made up of line segments and quarter helices.
The number of Turns is an integer. If Turns = zero, one turn is still made, a slight bug.
The user may Sweep the curve with a circle or rectangle, (flat mode suggested,) or other 2D object, placed at the beginning, tangent/perpendicular to the curve.
LineWeb programming style was used, but instead of a factories array, objectlists were used. Interpcurve was not used.

Normally the radius is less than or equal to the lesser of length/2 or width/2, otherwise the result will be non-standard.
"Stadium" curve occurs if 2*radius = length or width.
It is also possible to make a circle, a square, a rectangle, or a helix.

- Brian

EDITED: 31 Oct 2017 by BEMFARMER

Attachments: