Class nurbs.Knot
All Packages Class Hierarchy This Package Previous Next Index
Class nurbs.Knot
java.lang.Object
|
+----nurbs.Knot
public class Knot
extends Object
implements Cloneable
Sequence of basis functions for use by Nurbs
knot
numControlPoints
numKnots
order
TOLERANCE
Knot (int, int)
Constructor.
Knot (int, int, float[])
Constructor.
clone ()
Performs a deep copy of this Knot.
getKnots ()
Accessor method for the knot[] array
getNumControlPoints ()
Return number of control points.
interval (float[], float)
Determine where in the knot sequence t lies.
makeKnots (float, float)
Produce numKnots knots between tmin and tmax, with
tmin, tmax repeated order times and the remaining knots
distributed uniformly between.
setKnots (float[])
Accessor method for the knot[] array
toString ()
Creates a String representation for the Knot
unionKnots (Knot)
Merge the knot sequence knot2 into the current
knot.
order
protected int order
numControlPoints
protected int numControlPoints
numKnots
protected int numKnots
knot
protected float knot[]
TOLERANCE
public final static float TOLERANCE
Knot
public Knot(int order,
int numControlPoints)
Constructor.
Parameters:
order - the order of the Knot
numControlPoints - the number of control points
Knot
public Knot(int order,
int numControlPoints,
float knot[])
Constructor.
Parameters:
order - the order of the Knot
numControlPoints - the number of control points
knot - the array of knot values
Throws: IllegalArgumentException
when the
number of knots does not equal the order plus the number
of control points
getNumControlPoints
public int getNumControlPoints()
Return number of control points.
Returns:
the number of control points
setKnots
public void setKnots(float knot[])
Accessor method for the knot[] array
Parameters:
knot - the array of knots
getKnots
public float[] getKnots()
Accessor method for the knot[] array
Returns:
an array of knots
interval
protected static int interval(float knot[],
float t)
Determine where in the knot sequence t lies.
The knot parameter t must lie within the half-open
interval knot[0] <= t < knot[knot.length-1] .
Parameters:
knot - the array of knot values
t - the value to compare
Returns:
the array index of the highest-index knot
which is less than or equal to t
Throws: IllegalArgumentException
when the
knot parameter t is not within the half-open interval
makeKnots
protected void makeKnots(float tmin,
float tmax)
Produce numKnots knots between tmin and tmax, with
tmin, tmax repeated order times and the remaining knots
distributed uniformly between. Existing knot sequence
will be overwritten.
Parameters:
tmin - the minimum knot value
tmax - the maximum knot value
unionKnots
protected Knot unionKnots(Knot knot2)
Merge the knot sequence knot2 into the current
knot. Do not add knot parameters from knot2
which duplicate parameters already in this knot.
Parameters:
knot2 - the Knot to merge into this
Returns:
a new Knot
clone
public Object clone()
Performs a deep copy of this Knot.
Returns:
a new instance of Knot
Overrides:
clone in class Object
toString
public String toString()
Creates a String representation for the Knot
Returns:
a string representation of the Knot
Overrides:
toString in class Object
All Packages Class Hierarchy This Package Previous Next Index