Extends the Vector class with support for the Superformula algorithm.
The VectorShape class extends the Vector class with support for generating paths with the Superformula algorithm by Johan Gielis. This feature is not part of the SVG standard and therefore should not be used in cases where SVG compliance is a strict requirement.
The Superformula is documented in detail at Wikipedia: http://en.wikipedia.org/wiki/Superformula
The VectorShape class consists of the following fields:
Access | Name | Type | Comment | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | DOUBLE | A parameter for the Superformula. | |||||||||||||||||||||
This field sets the Superformula's 'A' parameter value. | |||||||||||||||||||||||
B | DOUBLE | A parameter for the Superformula. | |||||||||||||||||||||
This field sets the Superformula's 'B' parameter value. | |||||||||||||||||||||||
CenterX | DOUBLE | The center of the shape on the x-axis. Expressed as a fixed or scaled coordinate. | |||||||||||||||||||||
The horizontal center of the shape is defined here as either a fixed or scaled value. | |||||||||||||||||||||||
CenterY | DOUBLE | The center of the shape on the y-axis. Expressed as a fixed or scaled coordinate. | |||||||||||||||||||||
The vertical center of the shape is defined here as either a fixed or scaled value. | |||||||||||||||||||||||
Close | INT | A parameter for the super shape algorithm. | |||||||||||||||||||||
If TRUE, the shape path will be closed between the beginning and end points. | |||||||||||||||||||||||
Dimensions | INT | Dimension flags define whether individual dimension fields contain fixed or scaled values. | |||||||||||||||||||||
The following dimension flags are supported:
| |||||||||||||||||||||||
M | DOUBLE | A parameter for the Superformula. | |||||||||||||||||||||
This field sets the Superformula's 'M' parameter value. | |||||||||||||||||||||||
Mod | INT | A special modification parameter that alters the super shape algorithm. | |||||||||||||||||||||
The Mod field alters the super shape algorithm, sometimes in radical ways that allow entirely new shapes to be discovered in the super shape library. The value that is specified will result in a formula being applied to the generated 'r' value. Possible values and their effects are:
| |||||||||||||||||||||||
N1 | DOUBLE | A parameter for the super shape algorithm. | |||||||||||||||||||||
This field sets the Superformula's 'N1' parameter value. | |||||||||||||||||||||||
N2 | DOUBLE | A parameter for the super shape algorithm. | |||||||||||||||||||||
This field sets the Superformula's 'N2' parameter value. | |||||||||||||||||||||||
N3 | DOUBLE | A parameter for the super shape algorithm. | |||||||||||||||||||||
This field sets the Superformula's 'N3' parameter value. | |||||||||||||||||||||||
Phi | DOUBLE | A parameter for the super shape algorithm. | |||||||||||||||||||||
The Phi value has an impact on the length of the generated path. If the super shape parameters form a circular path (whereby the last vertex meets the first) then the Phi value should not be modified. If the path does not meet itself then the Phi value should be increased until it does. The minimum (and default) value is 2. It is recommended that the Phi value is increased in increments of 2 until the desired effect is achieved. | |||||||||||||||||||||||
Radius | DOUBLE | The radius of the generated shape. Expressed as a fixed or scaled coordinate. | |||||||||||||||||||||
The Radius defines the final size of the generated shape. It can be expressed in fixed or scaled terms. | |||||||||||||||||||||||
Repeat | INT | Repeat the generated shape multiple times. | |||||||||||||||||||||
If set to a value greater than one, the Repeat field will cause the generated shape to be replicated multiple times at consistent intervals leading to the center point. The Repeat value cannot be set in conjunction with Spiral. | |||||||||||||||||||||||
Spiral | INT | Alters the generated super shape so that it forms a spiral. | |||||||||||||||||||||
Setting the Spiral field to a value greater than one will cause the path generator to form spirals, up to the value specified. For instance, a value of 5 will generate five spirals. | |||||||||||||||||||||||
Vertices | INT | Limits the total number of vertices generated for the super shape. | |||||||||||||||||||||
Setting a value in Vertices will limit the total number of vertices that are generated for the super shape. This feature is useful for generating common convex geometrical shapes such as triangles, polygons, hexagons and so forth; because their vertices will always touch the sides of an elliptical area. |