|
||||||||||
| 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.LagrangeCurve
The Lagrange curve passes through the control-points specified by the group-iterator. It uses a knot-vector to control when the curve passes through each control-point. That is, if there is a knot-value for every control-point, then the curve will pass through point i when the value of t is knot[i], which is an interesting property. Figure 1 is an example of this.

In addition, when there is a knot-value for every point then the base-index should be 0, and the base-length should be n-1, where n is the size of the group-iterator.
A knot-vector with size less than n can still be used. In this case the Lagrange curve is generated in multiple sections. This approach works better when the points are roughly equally spaced. Figure 2 is an example of this.

Lagrange curves and also be closed as shown in figures 3 & 4.


Notes on the knot-vector, base-index and base-length. The size of the knot-vector specifies how many points are used for each section of the curve. The base-index specifies which point a section starts at. The base-index + base-length specify which point the section ends at. Once a section has been generated, the next section is generated starting from the end of the last section.
| Field Summary |
| Fields inherited from class com.graphbuilder.curve.Curve |
connect, cp, gi |
| Constructor Summary | |
LagrangeCurve(ControlPath cp,
GroupIterator gi)
Creates a LagrangeCurve with knot vector [0, 1/3, 2/3, 1], baseIndex == 1, baseLength == 1, interpolateFirst and interpolateLast are both false. |
|
| Method Summary | |
void |
appendTo(MultiPath mp)
For the control-points to be interpolated in order, the knot-vector values should be strictly increasing, however that is not required. |
protected void |
eval(double[] p)
The eval method evaluates a point on a curve given a parametric value "t". |
int |
getBaseIndex()
Returns the base-index. |
int |
getBaseLength()
Returns the base-length. |
boolean |
getInterpolateFirst()
If baseIndex > 0 then the first control-points will only be interpolated if interpolate-first is set to true. |
boolean |
getInterpolateLast()
If baseIndex + baseLength < numKnots - 1 then the last control-points will only be interpolated if interpolate-last is set to true. |
ValueVector |
getKnotVector()
Returns the knot-vector for this curve. |
int |
getSampleLimit()
Returns a value of 1. |
void |
resetMemory()
Resets the shared memory to the initial state. |
void |
setBaseIndex(int b)
The base-index is an index location into the knot vector such that, for each section, the curve is evaluated between [knot[baseIndex], knot[baseIndex + baseLength]]. |
void |
setBaseLength(int b)
The base-length along with the base-index specify the interval to evaluate each section. |
void |
setInterpolateFirst(boolean b)
Sets the value of the interpolateFirst flag. |
void |
setInterpolateLast(boolean b)
Sets the value of the interpolateLast flag. |
void |
setKnotVector(ValueVector v)
Sets the knot-vector for this curve. |
| 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 |
| Constructor Detail |
public LagrangeCurve(ControlPath cp,
GroupIterator gi)
appendTo(MultiPath)| Method Detail |
public int getBaseIndex()
setBaseIndex(int)public void setBaseIndex(int b)
java.lang.IllegalArgumentException - If base-index < 0.getBaseIndex()public int getBaseLength()
setBaseLength(int)public void setBaseLength(int b)
java.lang.IllegalArgumentException - If base-length <= 0.getBaseLength()public boolean getInterpolateFirst()
setInterpolateFirst(boolean)public boolean getInterpolateLast()
setInterpolateLast(boolean)public void setInterpolateFirst(boolean b)
getInterpolateFirst()public void setInterpolateLast(boolean b)
getInterpolateLast()public ValueVector getKnotVector()
setKnotVector(ValueVector)public void setKnotVector(ValueVector v)
java.lang.IllegalArgumentException - If the value-vector is null.getKnotVector()public int getSampleLimit()
getSampleLimit in class ParametricCurveprotected void eval(double[] p)
ParametricCurve
eval in class ParametricCurvepublic void appendTo(MultiPath mp)
appendTo in class CurveMultiPath,
BinaryCurveApproximationAlgorithmpublic void resetMemory()
Curve
resetMemory in class Curve
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||