SuperEllipse in OpenScad (Q53475)

From Library of Open Source Hardware
Jump to navigation Jump to search
No description defined
Language Label Description Also known as
English
SuperEllipse in OpenScad
No description defined

    Statements

    donb (http://www.thingiverse.com/donb) sent me a message recently about the SuperFormula (en.wikipedia.org/wiki/Superformula) as it reminded him of my other surface/solids work. Recognizing the fun challenge, I thought I'd code it up. But, instead of starting right away with the SuperFormula, I thought I'd start with the SuperEllipse, which is very close, and a step along the way anyway. This thing is an implementation of the SuperEllipse formula in OpenScad. What good is a SuperEllipse? Well, it's actually a surface of revolution. With it you can define the ellipsoid, sphere, cylinder, cube/rectangle, and myriad other funky looking shapes that are somehwere in between these. It's great because from one formula you get all sorts of things. Just imagine if this were a primitive in OpenScad, as it is in things like PovRAY. At any rate, the basic formulas are there. The fun thing is, you can render a point cloud if you want. That is, only the vertices, represented as tiny little spheres. You can also render as a wireframe. That's nice because you can see the structure, on the outside and the inside as well. Lastly, you can render as a polyhedron. Perhaps the most cool of all is that you could render as all three, at the same time, by just changing the values of some parameters. The important file is superellipse.scad. With this one comes the 'superellipse()' module. This has parameters you can change to get the different shapes. Within the code, there is a reference to a page that gives examples with different parameters. By default, it renders with a radius of [1,1,1]. You can easily use the 'scale()' module to get a different size. Although the thing will generate 2-manifold objects, it seems to be extremely expensive to do CSG operations on them. UPDATE: I added another picture that shows a checkerboard pattern on it. That's a little bit of "precedural texture", which I haven't actually released as yet, but I thought it looked cool.
    0 references
    https://spdx.org/licenses/CC-BY-4.0
    0 references
    0 references
    en
    0 references
    WilliamAAdams
    0 references
    auto
    0 references
    www.thingiverse.com
    0 references
    1.0.0
    0 references
    thingiverse.com
    0 references