de.grogra.vecmath.geom
Class Supershape
java.lang.Object
de.grogra.vecmath.geom.VolumeBase
de.grogra.vecmath.geom.TransformableVolume
de.grogra.vecmath.geom.ImplicitVolume
de.grogra.vecmath.geom.Supershape
- All Implemented Interfaces:
- Volume
public class Supershape
- extends ImplicitVolume
This class represents the geometry of a supershape. In local object
coordinates, its center is the origin, its radius is 1.
An implementation of Johan Gielis's Superformula which was published in the
American Journal of Botany 90(3): 333–338. 2003.
INVITED SPECIAL PAPER A GENERIC GEOMETRIC TRANSFORMATION
THAT UNIFIES A WIDE RANGE OF NATURAL AND ABSTRACT SHAPES
- Author:
- MH
Field Summary |
protected double |
a
|
protected double |
b
|
protected java.lang.ThreadLocal<ImplicitVolume.Locals> |
locals2
|
protected double |
m1
|
protected double |
m2
|
protected double |
n11
|
protected double |
n12
|
protected double |
n13
|
protected double |
n21
|
protected double |
n22
|
protected double |
n23
|
Fields inherited from class de.grogra.vecmath.geom.TransformableVolume |
m00, m01, m02, m10, m11, m12, m20, m21, m22, t0, t1, t2 |
Constructor Summary |
Supershape(float a,
float b,
float m1,
float n11,
float n12,
float n13,
float m2,
float n21,
float n22,
float n23)
|
Method Summary |
protected double |
f(double x,
double y,
double z)
|
protected Range |
f(Range x,
Range y,
Range z)
implicit function of the supershape |
void |
getExtent(Tuple3d min,
Tuple3d max,
Variables temp)
Computes the extent of this volume, i.e., an axis-aligned
bounding box between min and max . |
Methods inherited from class de.grogra.vecmath.geom.TransformableVolume |
getDiscExtent, getDiscsExtent, getFrobeniusNorm, getObjectToWorldRotationScale, getTransformation, invalidate, invTransformPoint, scale, setTransformation, setTransformation, transformPoint, transformTranspose, transformVector, translate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
a
protected double a
b
protected double b
locals2
protected final java.lang.ThreadLocal<ImplicitVolume.Locals> locals2
m1
protected double m1
m2
protected double m2
n11
protected double n11
n12
protected double n12
n13
protected double n13
n21
protected double n21
n22
protected double n22
n23
protected double n23
Supershape
public Supershape(float a,
float b,
float m1,
float n11,
float n12,
float n13,
float m2,
float n21,
float n22,
float n23)
f
protected double f(double x,
double y,
double z)
- Specified by:
f
in class ImplicitVolume
f
protected Range f(Range x,
Range y,
Range z)
- implicit function of the supershape
- Specified by:
f
in class ImplicitVolume
- Parameters:
x,
- y, z
- Returns:
- >0 outside, =0 surface, <0 inside
getExtent
public void getExtent(Tuple3d min,
Tuple3d max,
Variables temp)
- Description copied from interface:
Volume
- Computes the extent of this volume, i.e., an axis-aligned
bounding box between
min
and max
.
- Specified by:
getExtent
in interface Volume
- Overrides:
getExtent
in class ImplicitVolume
- Parameters:
min
- minimum coordinates of bounding box are placed in heremax
- maximum coordinates of bounding box are placed in heretemp
- has to be provided by the invoker, may be used in implementations