Squircle script

 From:  bemfarmer
5616.12 
Here is a different version of a squircle, which is not a superellipse.

_squircleFG script, by Brian McMillin 2/11/2022.
This script produces the Fernandez-Guasti squircle, which is an intermediate shape between the circle and the square.
https://arxiv.org/ftp/arxiv/papers/1604/1604.02174.pdf
tau, Є [0,1], is the linearized squareness parameter.
Click on "Click for 50%", for 50% squareness.
Radius, (radVal), = radius of circle = halfwidth of square.
Parametric value rho is the varying polar radius.

The "curve factory" is used, as it has a much nicer corner, for tau at or near 1.0, than the corner of the "interpcurve factory", which is wiggly. Note that numpoints should be an even number, for a slightly less rounded corner.

For tau = 1, (maximum squareness), the corner is still slightly rounded, and "show points" shows the control points for the curve. If numpoints is even, there is a control point at the corner, but it is NOT a "corner" control point. MoI cannot, currently, directly convert this point to a "corner" control point. The point can be manually deleted, (or odd numpoints used), and a "corner control point" inserted at the midpoint of the dotted line between the two remaining points nearby, and the new "corner" control point dragged to the corner of the square, to make the corner of the square a 90 degree corner.

Division by zero would occur at theta = nPI/2, so these 5 cases are handled individually, which is possible because the limits there goes to +/- radval.
Division by zero would also occur at tau = 0, so the tau slider has a min value of 0.000001. BUG?, In the Squareness menu, if tau is set to zero, the curve is blanked. Checking if tau === 0, and if sqfactor === 0, and setting their values to 0.000001 does NOT prevent entry of 0 into the tau menu causing blanking the curve. sinval === 0 checkdid not help either.

- Brian

EDITED: 13 Feb 2022 by BEMFARMER

Attachments: