SuperShapes in OpenScad
by WilliamAAdams, published
Liked ByView All
Give a Shout Out
If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.Print Thing Tag
Continuing the madness... I was getting laughed at in my Design 101 class, so the only way I thought of to silence the other kids was to come out with my SuperShapes!
After having done the previous SuperEllipse work, it was just a matter of time before the formulas came knocking at my door wanting to be implemented.
This thing implements the SuperFormula (muwaaahhhaahaaahaaa)!!
What the heck is that? Best thing is to take a look at the pretty pictures at this web site: http://paulbourke.net/geometry/supershape3d/
If you're really a math nutter, then take a look at the math as well. It's actually not that complicated. The complication here is just turning the formula into something that can be dealt with by OpenScad. In particular, making sure the thing turns out to be 2-manifold, so that you can actually generate .stl files and print the results, therein lies the rub.
The supershape.scad files contains two rotines of interest:
RenderSuperShape2D() - This takes the definition of a single supershape, and renders the curve of that supershape in 2D, using wireframe. With this single routine, you can go to the wiki entry for Superfomula (http://en.wikipedia.org/wiki/Superformula) and plug in the various numbers, and see pretty pictures.
RenderSuperShape() - This takes two supershape definitions (one modulates the other), and renders real pretty pictures. You can look at the Paul Bourke site to get very interesting parameters to plug into that one.
Another source of parameters might be POVRay files.
That's enough for a Friday post I think.
But wait, there's more...
You also get the procedural texture mapping checkerboard pattern, thrown in for free. What is procedural texture mapping? Well, instead of using a bitmap to represent the different colors (or heights) on an object, you can just call a routine and ask it for the color at a particular position. No fus, no muss, no arrays to slow you down! At any rate, it's just a little hidden gem.
This code is public domain. I figure having such a nice routine freely available might encourage people to make some very interesting shapes.
Challenge: How the heck do you get OpenScad to display in wireframe, and with a fade on the other colors?
Added the tristar.stl file. This was an experiment in rendering the 2D shapes with faces, and not just wireframes, then using them with CSG operations. The result is of course a deadly weapon once rendered in hardened steel and sharpened.
1) Download the .scad files
2) Open up the test_supershape.scad file and play around with routines
3) See something you like, generate .stl
Upgrade this Thing with Thingiverse AppsCustomization
Edit, personalize, or revise this ThingPrint Fulfilment
Order a print of this ThingTools and Utilities
Repair, slice, or enhance this Thing
SuperShapes in OpenScad by WilliamAAdams is licensed under the Public Domain license.
What does this mean?
- Remixing or Changing this Thing is allowed.
- Commercial use is allowed.
Show Some Love
Say thanks by giving WilliamAAdams a tip and help them continue to share amazing Things with the Thingiverse community.Tip Designer
We're sure WilliamAAdams would love to see what you've printed. Please document your print and share a Make with the community.
To post a Make simply visit this Thing again and click I Made One to start uploading your photo. It’s even easier to post a Make via the Thingiverse Mobile app (available via Google Play and Apple App Store).