|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttoxi.geom.Spline3D
public class Spline3D
This is a generic 3D B-Spline class for curves of arbitrary length, control handles and patches are created and joined automatically as described here: ibiblio.org/e-notes/ Splines/Bint.htm
Thanks to a bug report by Aaron Meyers (http://universaloscillation.com) the computeVertices(int) method has a slightly changed behaviour from version 0014 onwards. In earlier versions erroneous duplicate points would be added near each given control point, which lead to various weird results.
The new behaviour of the curve interpolation/computation is described in the docs for the computeVertices(int) method below.
Field Summary | |
---|---|
BernsteinPolynomial |
bernstein
|
float[] |
bi
|
Vec3D[] |
coeffA
|
static int |
DEFAULT_RES
|
static float |
DEFAULT_TIGHTNESS
|
Vec3D[] |
delta
|
java.util.List<Vec3D> |
pointList
|
java.util.List<Vec3D> |
vertices
|
Constructor Summary | |
---|---|
Spline3D()
Constructs an empty spline container with default curve tightness. |
|
Spline3D(java.util.List<Vec3D> rawPoints)
|
|
Spline3D(java.util.List<Vec3D> rawPoints,
BernsteinPolynomial b,
float tightness)
|
|
Spline3D(Vec3D[] pointArray)
|
|
Spline3D(Vec3D[] pointArray,
BernsteinPolynomial b,
float tightness)
|
Method Summary | |
---|---|
Spline3D |
add(float x,
float y,
float z)
|
Spline3D |
add(ReadonlyVec3D p)
Adds the given point to the list of control points. |
java.util.List<Vec3D> |
computeVertices(int res)
Computes all curve vertices based on the resolution/number of subdivisions requested. |
java.util.List<Vec3D> |
getDecimatedVertices(float step)
Computes a list of points along the spline which are uniformly separated by the given step distance. |
java.util.List<Vec3D> |
getDecimatedVertices(float step,
boolean doAddFinalVertex)
Computes a list of points along the spline which are uniformly separated by the given step distance. |
float |
getEstimatedArcLength()
|
int |
getNumPoints()
Returns the number of key points. |
java.util.List<Vec3D> |
getPointList()
|
float |
getTightness()
|
Spline3D |
setPointList(java.util.List<Vec3D> plist)
|
Spline3D |
setTightness(float tightness)
Sets the tightness for future curve interpolation calls. |
void |
updateCoefficients()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float DEFAULT_TIGHTNESS
public static final int DEFAULT_RES
public java.util.List<Vec3D> pointList
public java.util.List<Vec3D> vertices
public BernsteinPolynomial bernstein
public Vec3D[] delta
public Vec3D[] coeffA
public float[] bi
Constructor Detail |
---|
public Spline3D()
add(ReadonlyVec3D)
.
public Spline3D(java.util.List<Vec3D> rawPoints)
rawPoints
- list of control point vectorspublic Spline3D(java.util.List<Vec3D> rawPoints, BernsteinPolynomial b, float tightness)
rawPoints
- list of control point vectorsb
- predefined Bernstein polynomial (good for reusing)tightness
- default curve tightness used for the interpolated vertices
setTightness(float)public Spline3D(Vec3D[] pointArray)
pointArray
- array of control point vectorspublic Spline3D(Vec3D[] pointArray, BernsteinPolynomial b, float tightness)
pointArray
- array of control point vectorsb
- predefined Bernstein polynomial (good for reusing)tightness
- default curve tightness used for the interpolated vertices
setTightness(float)Method Detail |
---|
public Spline3D add(float x, float y, float z)
public Spline3D add(ReadonlyVec3D p)
p
-
public java.util.List<Vec3D> computeVertices(int res)
Computes all curve vertices based on the resolution/number of subdivisions requested. The higher, the more vertices are computed:
(number of control points - 1) * resolution + 1
Since version 0014 the automatic placement of the curve handles can also be manipulated via the setTightness(float) method.
res
- the number of vertices to be computed per segment between
original control points (incl. control point always at the
start of each segment)
public java.util.List<Vec3D> getDecimatedVertices(float step)
step
-
public java.util.List<Vec3D> getDecimatedVertices(float step, boolean doAddFinalVertex)
step
- doAddFinalVertex
- true, if the last vertex computed by
computeVertices(int)
should be added regardless of
its distance.
public float getEstimatedArcLength()
computeVertices(int)
.public int getNumPoints()
public java.util.List<Vec3D> getPointList()
public float getTightness()
setTightness(float)
public Spline3D setPointList(java.util.List<Vec3D> plist)
plist
- the pointList to set
public Spline3D setTightness(float tightness)
tightness
- the tightness value used for the next call to
computeVertices(int)
public void updateCoefficients()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |