Skip to content

2D superformula line-art generator built in Processing, with SVG export for use in digital fabrication workflows.

Notifications You must be signed in to change notification settings

jasonwebb/SuperformulaSVG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SuperformulaSVG

Generative superformula vector-based line-art sketch for Processing, supporting both SVG and raster image output.

Uses some core code provided by Form+Code.

About the superformula

The superformula is a mathematical method for generating radial geometry with diverse, often organic-looking features. It is described by the following formula:

Superformula equation

Where φ (phi) is an angle (between 0-359) and the resulting value r being the radius of the geometry at that angle.

Here is how I like to think of the parameters and how they affect the resulting drawing:

  • a seems to affect lateral stretching
  • b seems to affect vertical stretching
  • m affects the degree of rotational symmetry. Large values means more peaks/spikes.
  • n1, n2, n3 all affect the concavity/convexity of spikes and how far they extend from the center. In tandem the can be used to make the form more 'bloated' or 'pinched'.

Following the example set by the original Form+Code example I also include the ability to run multiple iterations of the superformula with slightly changing (decaying) parameter values. You can control these parameters using the iterations and decay sliders.

Learn more about the superformula through:

Keyboard commands:

  • Space = trigger a new iteration
  • s = save an SVG containing all geometry on screen
  • i = save an image (PNG) of the current screen
  • r = randomize parameters
  • n = invert colors
  • h = hide/show UI
  • p = save parameters to JSON file
  • l = load parameters from JSON file

Screenshots

Single drawing

Three columns, two rows

Lots of rows and columns

About

2D superformula line-art generator built in Processing, with SVG export for use in digital fabrication workflows.

Topics

Resources

Stars

Watchers

Forks

Packages