Supershapes / SuperFormula

Next
 From:  bemfarmer
4766.1 
SuperFormula2D MoI script (2D version)
Based upon equations by Johan Gielis http://www.amjbot.org/content/90/3/333.short
"A GENERIC GEOMETRIC TRANSFORMATION THAT UNIFIES A WIDE RANGE OF NATURAL AND ABSTRACT SHAPES"
Supershapes by Paul Borke http://paulbourke.net/geometry/supershape/
December 5, 2011
There are several programs on the net, even a version for the iphone.
Now to tackle the 3D version...





For fractional arms, increase phi multiplier. (For example, .125 * 8 = 1)

There seems to be some asymmetry in a few arms under some settings.

EDITED: 19 Feb 2014 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:  FelixPQ (FELIX)
4766.2 In reply to 4766.1 
Hi,

you seem to like writing scripts to apply mathematical formulas and I'm one of those who like using them. So thank you very much for your work.

Regards,
Felix
  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
4766.3 
Made a 3d script. It can be pretty slow.
Seems to be a gap problem with first or second latitude.
Switched to half of a "spherical" shape.

Really, for the symetrical shapes, just need one latitude to revolve in MoI.





EDITED: 27 Mar 2012 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
4766.4 
Here is raw, barely tested script.
Phi_multiple doesn't do anything.

Edit: Seems using the same i index 2 places in the same for loop, may be bad for a script...
Edit, changed 2nd usage of i index to a k index. Put the index start point back at zero, (like in other MoI scripts).
This got rid of the hole at the south pole.

Edit: Deleted the old script, due to poor programmer understanding of when/where to do updates to factory/factories.
Moved the factories update out of the i and j loops, and added a simple factory update. Much faster performance.
Maybe the factories is not even needed?

Could upload new version, but maybe should work on it some more...

EDITED: 7 Dec 2011 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:  BurrMan
4766.5 In reply to 4766.4 
Cool stuff. Seems it is always a bit short of a full tangential 180?


EDITED: 19 Jun 2012 by BURRMAN

  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
4766.6 In reply to 4766.5 
Seems to be some math "problems". (?)
Or script problems... Have to look some more...
I noticed a couple of times, doing a form, deleting it, and redoing it, changed from "hex" to "round"... That seemed weird.
Divide by zero?
There is some kind of limit to how much detail gets calculated by javascript or (MoI)?...
Memory or something gets filled up, or clogged up, with very large curve and point numbers?...so that re-starting the
script just doesn't work, gets "thrown out" by MoI. But all works good if MoI is restarted.
Maybe a lack of script "cleanup"?...
(Just some unskilled guesses.)

The base equations are that of circle, or ellipse, so a closed form is calculated for a full 2*pi ...?...

Edit, changed 2nd usage of i index to a k index. Put the index start point back at zero, (like in other MoI scripts).
This got rid of the hole at the south pole.

EDITED: 7 Dec 2011 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
4766.7 
Edit: Deleted the old script, due to poor programmer understanding of when/where to do updates to factory/factories.
Moved the factories update out of the i and j loops, and added a simple factory update. Much faster performance.

Attached improved script.

Edit, revised script in post 10 below.

EDITED: 23 Jan 2014 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:  Frenchy Pilou (PILOU)
4766.8 
Seems there is a glitch! :)

---
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
4766.9 In reply to 4766.8 
I'll have a look. Probably the index needs adjusting.

- 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
4766.10 
Made some modifications to this 2 year old script, which was of learning benefit back then.
The script has a lot of variables.

Roughly speaking, for 100% of a 360 degree set of curves, the new version avoids a duplicating overlap of the first and last drawn curves, by not
drawing the zero-ith curve. It will also do a percentage of a 360 degree set of curves, for example a 180 degree set of curves, including the zero-ith curve.
The default htm uses Pilou's example, with uDensity = 9, for creation of 9 curves.

Had quite a difficult time adjusting indexes.

- Brian

EDITED: 23 Jan 2014 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:  Frenchy Pilou (PILOU)
4766.11 
Excellent!

---
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
 From:  Frenchy Pilou (PILOU)
4766.12 
;)

---
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
 

Reply to All Reply to All