|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.geom.GeometryGenerator org.j3d.geom.SpringGenerator
public class SpringGenerator
A generator of Spring geometry with customisable inner radius, outer radius, number of loops, spacing and facet count.
The outer radius is the radius of the center of the tube that forms the spring. The spring has the outer radius in the X-Z plane and it increments along the positive Y axis. The first loop starts at the origin on the positive X axis and rotates counter-clockwise when looking down the -Y axis towards the X-Z plane.
Constructor Summary | |
---|---|
SpringGenerator()
Construct a default spring that has: inner radius: 0.25 outer radius: 1.0 inner facet count: 16 outer facet count: 16 loop count: 4 loop spacing: 1.0 |
|
SpringGenerator(float spacing)
Construct a spring with the given loop spacing and all other values fixed at the defaults. |
|
SpringGenerator(float ir,
float or)
Construct a spring that has the given radius values with all other values fixed at the defaults |
|
SpringGenerator(float ir,
float or,
float spacing,
int lc)
Construct a spring with the given radius, spacing and loop count information. |
|
SpringGenerator(float ir,
float or,
float spacing,
int lc,
int ifc,
int ofc)
Construct a spring with the given radius, spacing and loop count information, and facet count. |
|
SpringGenerator(int lc)
Construct a spring that has the given number of loops with all other values fixed at the defaults. |
|
SpringGenerator(int ifc,
int ofc)
Construct a spring that has the selected number of facets but with all other values fixed at the defaults. |
Method Summary | |
---|---|
void |
generate(GeometryData data)
Generate a new set of geometry items shaped on the passed data. |
float[] |
getDimensions()
Get the dimensions of the spring. |
int |
getVertexCount(GeometryData data)
Get the number of vertices that this generator will create for the shape given in the definition. |
void |
setDimensions(float ir,
float or)
Change the dimensions of the torus to be generated. |
void |
setFacetCount(int ifc,
int ofc)
Change the number of facets used to create this spring. |
void |
setLoopDimensions(float spacing,
int lc)
Change the loop information. |
Methods inherited from class org.j3d.geom.GeometryGenerator |
---|
createFaceNormal, createFaceNormal, createRadialNormal, createRadialNormal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpringGenerator()
public SpringGenerator(float ir, float or)
ir
- The inner radius to useor
- The outer radius to usepublic SpringGenerator(int lc)
lc
- The loop count
java.lang.IllegalArgumentException
- The loop count was invalidpublic SpringGenerator(float spacing)
spacing
- The spacing between loopspublic SpringGenerator(int ifc, int ofc)
ifc
- The number of facets to use around the inner radiusofc
- The number of facets to use around the outer radius
java.lang.IllegalArgumentException
- The number of facets is less than 3public SpringGenerator(float ir, float or, float spacing, int lc)
ir
- The inner radius to useor
- The outer radius to usespacing
- The spacing between loopslc
- The loop count
java.lang.IllegalArgumentException
- The loop count was invalidpublic SpringGenerator(float ir, float or, float spacing, int lc, int ifc, int ofc)
ir
- The inner radius to useor
- The outer radius to usespacing
- The spacing between loopslc
- The loop countifc
- The number of facets to use around the inner radiusofc
- The number of facets to use around the outer radius
java.lang.IllegalArgumentException
- The loop count was invalid or facet
counts were less than 4Method Detail |
---|
public float[] getDimensions()
public void setDimensions(float ir, float or)
ir
- The ir of the cone to generateor
- The or of the bottom of the conepublic void setLoopDimensions(float spacing, int lc)
spacing
- The spacing between loopslc
- The loop count
java.lang.IllegalArgumentException
- The loop count was invalidpublic void setFacetCount(int ifc, int ofc)
ifc
- The number of facets to use around the inner radiusofc
- The number of facets to use around the outer radius
java.lang.IllegalArgumentException
- The number of facets is less than 4public int getVertexCount(GeometryData data) throws UnsupportedTypeException
getVertexCount
in class GeometryGenerator
data
- The data to shape the calculations on
UnsupportedTypeException
- The generator cannot handle the type
of geometry you have requested.public void generate(GeometryData data) throws UnsupportedTypeException, InvalidArraySizeException
generate
in class GeometryGenerator
data
- The data to shape the calculations on
InvalidArraySizeException
- The array is not big enough to contain
the requested geometry
UnsupportedTypeException
- The generator cannot handle the type
of geometry you have requested
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |