public class BezierCurve extends ParametricCurve
General n-point Bezier curve implementation. The Bezier curve defines itself using all the points from the control-path specified by the group-iterator. To compute a single point on the curve requires O(n) multiplications where n is the group-size of the group-iterator. Thus, the Bezier curve is considered to be expensive, but it has several mathematical properties (not discussed here) that make it appealing. Figure 1 shows an example of a Bezier curve.
The maximum number of points that the Bezier curve can use is 1030 because the evaluation of a point uses the nCr (n-choose-r) function. The computation uses double precision, and double precision cannot represent the result of 1031 choose i, where i = [500, 530].
Curve
,
PascalsTriangle
Constructor and Description |
---|
BezierCurve(ControlPath cp,
GroupIterator gi) |
Modifier and Type | Method and Description |
---|---|
void |
appendTo(MultiPath mp)
The only requirement for this curve is the group-iterator must be in range or this method returns quietly.
|
void |
eval(double[] p)
The eval method evaluates a point on a curve given a parametric value "t".
|
int |
getSampleLimit()
The sample limit specifies how many additional subdivisions are done to ensure that there
are no missed pieces of the curve.
|
void |
resetMemory()
Resets the shared memory to the initial state.
|
void |
setInterval(double t_min,
double t_max)
Specifies the interval that the curve should define itself on.
|
void |
setSampleLimit(int limit)
Sets the sample-limit.
|
double |
t_max()
Returns the finishing interval value.
|
double |
t_min()
Returns the starting interval value.
|
getConnect, getControlPath, getGroupIterator, setConnect, setControlPath, setGroupIterator
public BezierCurve(ControlPath cp, GroupIterator gi)
public void eval(double[] p)
ParametricCurve
eval
in class ParametricCurve
public int getSampleLimit()
ParametricCurve
getSampleLimit
in class ParametricCurve
public void setSampleLimit(int limit)
IllegalArgumentException
- If sample-limit < 0.BinaryCurveApproximationAlgorithm
,
getSampleLimit()
public void setInterval(double t_min, double t_max)
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 void appendTo(MultiPath mp)
appendTo
in class Curve
MultiPath
,
BinaryCurveApproximationAlgorithm
public void resetMemory()
Curve
resetMemory
in class Curve
Copyright © 2016. All rights reserved.