Supershape in 3D

(Also known as the Superformula)

Written by Paul Bourke
July 2003

Based upon equations by Johan Gielis
Intended as a modelling framework for natural forms.

See also: Supershapes in 2D

Contribution of MSWindows version by Vincent Berthoux: supershape_win.zip



Table of contents

Software
Examples
Non integer m
2D
Extrusion
Stability
Classical forms
Shells
Toroidal mapping
Renderings
Physical model


Definition of supershape in 2 dimensions.

Extension to 3D using the spherical product.

Software

The following shows the interface developed to explore 3D supershapes. It is based upon X-Windows and OpenGL and as such is interactive. It is currently available for Mac OS-X (as a UNIX application) upon payment of a US$30 shareware fee. Use of the program is straightforward, edit fields and hit return. The left mouse button rotates the model in two axes, the middle mouse button rotates about the third axis. The right mouse button brings up a menu.

A limited version of the program can be downloaded free. In the case of the Mac OS-X version it is necessary to have X11 running. In both cases it is expected OpenGL capable graphics card and drivers are installed. These versions also allow you to check the software works on your platform before getting the full version.

Trial: supershape_mac.zip (ppc), supershape_mac.zip (intel)

 


Click for full size image

Command line interface

Many settings can be intialised from the command line, others control is given by single key strokes. To see a complete list type the program name at the command prompt with a "-h" option. At the time of writing these are given below.

>supershape -h
Usage: supershape [command line options]
Command line options
            -h   this text
            -f   full screen
            -s   active stereo
           -ss   dual screen stereo
            -a   auto rotate
           -rw   wireframe
           -rs   flat shaded
           -rp   specular shaded
Mouse buttons
          left   camera rotate
    shift left   camera pan
        middle   camera roll
  shift middle   camera forward, reverse

Key Strokes
    arrow keys   camera rotate
           <,>   camera forward, reverse
           +,-   camera zoom in, out
           [,]   camera roll
             r   toggle window recording
             w   capture window to TGA file
             a   toggle auto rotation of camera
         1,2,3   different rendering mode
             h   camera to home position
      f1 to f6   axis aligned camera positions
         ESC,q   quit
Features

Examples

Non integer values of m

2D

The 2D supershapes (but with added small thickness) can be created using this software by setting the second supershape parameters as m=0, n1=n2=n3=1, a=b=1 and using a small z axis scale factor. Indeed this can often be the preferred approach for using a 2D form within a 3D model, after all, real world objects do have some thickness. The example on the left has a thickness of 0.02 units (x and y axis dimensions of 1). Or even set the depth to 0 and vary latitude from 0 to 90 degrees as in the example on the right.

Extrusion

Extrusions of 2D supershapes can be created by setting the second supershape parameters as m=4, a=1, b=1, and high equal values for each of n1,n2,n3. For example n1=n2=n3=200 gives relatively sharp edges.

Stability

A significant portion of the parameter space results in surfaces with various types of numerical problems (powers of negative numbers, divide by 0, underflow, overflow, etc) as well as issues related to the representation of 3D graphics. The software that has been developed and created the images shown above, can display the edges where numerical problems have arisen. These regions are shown in pick as shown in the following two images.

Classical shapes

Cube

Cone

Diamond

Sphere

Prism

Cylinder

Hexagon

Pentagon

Shells

The supershape function can obviously be modulated by another function. For example to create the shell like structures below, the radius (r1) of the superformula that varies the longitude is scaled by either a logarithmic or Archimedes spiral. In some cases the z coordinate is additionally made a linear function of longitude.

Toroidal mapping

In the above the two supershapes were mapped onto a topological sphere. One could map supershapes onto other forms as well, for example, a torus. In the following images the mapping is as follows:

Renderings


Contribution by Luc Benard


Contributions by Albert Kiefer

Physical models




Generating the 3D Supershape in Povray

Written by Paul Bourke
July 2003

Based upon equations by Johan Gielis
Intended as a modelling framework for natural forms.


There are two (at least) ways of representing supershapes using PovRay. One is to use the builtin parametric primitive, doing it this way would result in the highest resolution/quality results unfortunately the rendering times proved to be prohibitive. The approach illustrated below is to write a macro in the PovRay scene language. The macro and an example of it's use is given in this PovRay (version 3.5) file: supershape.pov.


SuperShape(9,1,1,92,0.3,-45,4,1,1,-0.8,88,-0.35,202)

SuperShape(1,1,1,77,0.81,71.7,8,1,1,0.63,2.92,0.24,200)

SuperShape(9,1,1,-70,-0.14,77,2,1,1,0.38,4.12,-0.7,200)

SuperShape(7,1,1,20.45,-0.33,-3.54,6,1,1,-0.96,4.46,0.52,200)

Further POVRay scene examples are given below
    ss_macro1.inc example1.pov
    ss_macro2.inc example2.pov
    ss_macro3.inc example3.pov
      example4.pov

Contributions from the POVRay competition

Author: SpB
Title: Flying wing
Source: 0001.pov
Author: Dalius Dobravolskas
Title: Lost in the sea
Source: 0002.pov
Author: Paul Bourke
Title: Supershape fractal
Source: 0003.pov
Author: Stefano Tessarin
Title: Flowers
Source: 0004.pov
Author: Emanuele Munarini
Source: 0005.pov
Author: Emanuele Munarini
Source: 0006.pov
Author: Emanuele Munarini
Source: 0007.pov
Author: Emanuele Munarini
Source: 0008.pov
Author: Ben Scheele
Title: Butterflies find cactus flowers in a desert
Source: 0009.pov