Squircle script
 1-20  21-40  41-44

Next
 From:  bemfarmer
5616.1 
Here is a simple script to make a squircle, also superellipses.

Had trouble getting the curve to close, probably due to sine, cosine, or power javascript (?), so had to add the first point to the end of the
curve factory.




// References:
// http://paulbourke.net/geometry/superellipse/
// http://mathworld.wolfram.com/Superellipse.html

Rebuild can reduce the point count a lot, without much change in the curve.

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
5616.2 In reply to 5616.1 
Nice.....
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
5616.3 
Squircle cube. Rebuild,Trim,Network,Mirror.
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael T. (MICTU_UTCIM)
5616.4 
I just downloaded. I'll check it out later. Looks to be pretty useful. Thanks!

Michael T.
Michael Tuttle a.k.a. mictu http://www.coroflot.com/DesignsByTuttle
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  scott (SCOTTH)
5616.5 In reply to 5616.4 
Looks useful. I'm new to MoI though...
I know where to put the files, but how do I access the script from within MoI?

Thanks
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
5616.6 In reply to 5616.5 
Press the key TAB then write SuperEllipse2D
or make a ShortCut and write SuperEllipse2D inside the second column

Then Press the key TAB then write Rebuild if you don't want so many points ;)

EDITED: 5 Jan 2013 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  scott (SCOTTH)
5616.7 In reply to 5616.6 
Thanks.

I figured it out but you beat me back to the forum.
The files in the command folder are quite literally commands that you can assign shortcut keys to.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
5616.8 In reply to 5616.7 
Hi scott, yup that's correct - it's the actual name of the file itself (without any extensions on the end of it like .js or .htm) that is used as the command name.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
5616.9 
Here is an upgrade of the squircle script, "SquircleZ2D," for placing half a squircle between two picked points.
The squircle is drawn in the z axis direction, but may have some portion with an x or y component.

Added in a slider for the shape. The slider does not continously update like the binding "Bulge" one in MoI blend factory, or maybe I've left something out.
(Another version has just numeric entry for the shape value.)

It is required that for the two points, either the x values must not be equal, or that the y values must not be equal. There is some buggy-ness in 3D view,
in the event that respectively, the x values and the y values are each very nearly equal.

I anticipate using the script to place squircles on two guide rails, in Top view, for a sweep.
Checking the repeat box permits many curves to be placed, quickly.

Did some testing with a cube edge skeleton, in 3D view.
Negative heights are allowed.
Used cross product to create an orthogonal axis for a new frame.
Re-used lots of code from many other scripts.
Did not provide for foreign languages "substitution" of name labels..."



Now to go back to the extremely difficult Levenberg-Marquardt solver.

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
5616.10 In reply to 5616.9 
About the algorithm
it's more easy say calculate in front view the Squircilcle between distance 2 points given, then rotate this result in the 3D Space
or calculate directly between 2 points in the 3Dspace ?
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
5616.11 In reply to 5616.10 
peut etre?

Edit: Will try something else for the newport shell. The edge just needs to be swept or flowed or networked along 3D curve(s)...

EDITED: 7 Mar 2013 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 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:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
5616.13 
_squircularCyl script, (non-uniform), by Brian McMillin 2/13/2022.

This script produces a square to round cylinder, as per page 27 of the paper by Fong for 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
(For a uniform squircular cylinder, just extrude one squircle.)

loft suggested.

extruding the top and bottom squircles, and blending their two edges produces a similar, but different shape.

- Brian

EDITED: 14 Feb 2022 by BEMFARMER


  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
5616.14 
SquircularConeNOT.
Call it serendipity. This script was supposed to produce a square to round cone, as per page 27 of the paper by Fong, but something unknown went wrong. After a loft, the 3D shape was so cute, I decided to keep the script. The only change was to multiply the radval by tau. (repetitively, by mistaken code.)

- Brian

EDITED: 14 Feb 2022 by BEMFARMER

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
5616.15 In reply to 5616.14 
Thanks again Brian!

In the SquircleNOT loft, I added a point to end it.

Remember the point included at the end of loft allows the loft to end in a point...

Just 2Cents! But Thanks again for all the contributions you have made!

Burr
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
5616.16 In reply to 5616.14 
Here is a non-uniform SquircularCone.
radval = radiusMax * tau. (rather than repeatedly multiplying radval by tau.)

This cone looks good also.

Setting z=0 puts all the squircles in a plane.

- Brian

Undone, is a squircular cone with constant tau squareness in each cone, with tau varying between cones.
Maybe tomorrow.
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
5616.17 In reply to 5616.15 
Thank you Burr.
Adding a point looks good.

Object looks like some building or tower roof...

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  wayne hill (WAYNEHILL5202)
5616.18 In reply to 5616.17 
Hi Brian,

Is this something that you would consider making into a node for the Node editor? ( Please say yes, because it I would also like to make it into a node, but you know far more as to how it works.)

Wayne
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
5616.19 In reply to 5616.18 
Hi Wayne,
Feel free to make the squircle variations into a node, or nodes.

I would, but am not so good a programmer, and winter light duty time will soon be gone.
And I have not finished the other script that has occupied the past 2 months.

This morning, I had a few ideas regarding a few, mostly "cone", combinations.
Basically to separate radius value from tau squareness.
Have radius value either fixed, or linearly variable, or geometrically variable.
Have tau either fixed, or variable.
(Modes?)

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
5616.20 In reply to 5616.18 
Here is a DRAFT version of a squircle node.
Add on an Output node, and the script works. Still does not like a sqfactor of 0.0.
Place the two files in the extension directory of nodeeditor.
Alternatively, the squirclefn file can be placed in the lib directory. It just contains two functions.
Still wondering if the two functions could be put in the squircle.js node file.

More testing to do...

- Brian

See post 38 for "final" version.

EDITED: 20 Feb 2022 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
Show messages:  1-20  21-40  41-44