|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.graphbuilder.curve.Curve
com.graphbuilder.curve.ParametricCurve
com.graphbuilder.curve.BSpline
General non-rational B-Spline implementation where the degree can be specified.
For the B-Spline, there are 3 types of knot-vectors, uniform clamped, uniform unclamped, and non-uniform. A uniform knot-vector means that the knots are equally spaced. A clamped knot-vector means that the first k-knots and last k-knots are repeated, where k is the degree + 1. Non-uniform means that the knot-values have no specific properties. For all 3 types, the knot-values must be non-decreasing.
Here are some examples of uniform clamped knot vectors for degree 3:
number of control points = 4: [0, 0, 0, 0, 1, 1, 1, 1] number of control points = 7: [0, 0, 0, 0, 0.25, 0.5, 0.75, 1, 1, 1, 1]
The following is a figure of a B-Spline generated using a uniform clamped knot vector:

Here are some examples of uniform unclamped knot vectors for degree 3:
number of control points = 4: [0, 0.14, 0.29, 0.43, 0.57, 0.71, 0.86, 1] (about) number of control points = 7: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]
The following is a figure of a B-Spline generated using a uniform unclamped knot vector:

Note: Although the knot-values in the examples are between 0 and 1, this is not a requirement.
When the knot-vector is uniform clamped, the default interval is [0, 1]. When the knot-vector is uniform unclamped, the default interval is [grad * degree, 1 - grad * degree], where grad is the gradient or the knot-span. Specifying the knotVectorType as UNIFORM_CLAMPED or UNIFORM_UNCLAMPED means that the internal knot-vector will not be used.
Note: The computation required is O(2^degree) or exponential. Increasing the degree by 1 means that twice as many computations are done.
| Field Summary | |
static int |
NON_UNIFORM
|
static int |
UNIFORM_CLAMPED
|
static int |
UNIFORM_UNCLAMPED
|
| Fields inherited from class com.graphbuilder.curve.Curve |
connect, cp, gi |
| Constructor Summary | |
BSpline(ControlPath cp,
GroupIterator gi)
|
|
| Method Summary | |
void |
appendTo(MultiPath mp)
There are two types of requirements for this curve, common requirements and requirements that depend on the knotVectorType. |
protected void |
eval(double[] p)
The eval method evaluates a point on a curve given a parametric value "t". |
int |
getDegree()
Returns the degree of the curve. |
ValueVector |
getKnotVector()
Returns the knot-vector for this curve. |
int |
getKnotVectorType()
Returns the type of knot-vector to use. |
int |
getSampleLimit()
The sample limit specifies how many additional subdivisions are done to ensure that there are no missed pieces of the curve. |
boolean |
getUseDefaultInterval()
Returns the value of the useDefaultInterval flag. |
protected double |
N(double t,
int i)
Non-recursive implementation of the N-function. |
void |
resetMemory()
Resets the shared memory to the initial state. |
void |
setDegree(int d)
Sets the degree of the curve. |
void |
setInterval(double t_min,
double t_max)
Specifies the interval that the curve should define itself on. |
void |
setKnotVector(ValueVector v)
Sets the knot-vector for this curve. |
void |
setKnotVectorType(int type)
Sets the type of knot-vector to use. |
void |
setSampleLimit(int limit)
Sets the sample-limit. |
void |
setUseDefaultInterval(boolean b)
Sets the value of the useDefaultInterval flag. |
double |
t_max()
Returns the finishing interval value. |
double |
t_min()
Returns the starting interval value. |
| Methods inherited from class com.graphbuilder.curve.Curve |
getConnect, getControlPath, getGroupIterator, setConnect, setControlPath, setGroupIterator |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int UNIFORM_CLAMPED
public static final int UNIFORM_UNCLAMPED
public static final int NON_UNIFORM
| Constructor Detail |
public BSpline(ControlPath cp,
GroupIterator gi)
| Method Detail |
protected void eval(double[] p)
ParametricCurve
eval in class ParametricCurve
public void setInterval(double t_min,
double t_max)
java.lang.IllegalArgumentException - If t_min > t_max.t_min(),
t_max()public double t_min()
setInterval(double, double),
t_max()public double t_max()
setInterval(double, double),
t_min()public int getSampleLimit()
ParametricCurve
getSampleLimit in class ParametricCurvepublic void setSampleLimit(int limit)
java.lang.IllegalArgumentException - If sample-limit < 0.BinaryCurveApproximationAlgorithm,
getSampleLimit()public int getDegree()
setDegree(int)public void setDegree(int d)
java.lang.IllegalArgumentException - If degree <= 0.getDegree()public ValueVector getKnotVector()
setKnotVector(ValueVector)public void setKnotVector(ValueVector v)
java.lang.IllegalArgumentException - If the value-vector is null.getKnotVector()public boolean getUseDefaultInterval()
setUseDefaultInterval(boolean)public void setUseDefaultInterval(boolean b)
getUseDefaultInterval()public int getKnotVectorType()
setKnotVectorType(int)public void setKnotVectorType(int type)
java.lang.IllegalArgumentException - If the knot-vector type is unknown.getKnotVectorType()public void appendTo(MultiPath mp)
appendTo in class CurveMultiPath,
BinaryCurveApproximationAlgorithm
protected double N(double t,
int i)
public void resetMemory()
Curve
resetMemory in class Curve
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||