Class nurbs.Nurbs
All Packages Class Hierarchy This Package Previous Next Index
Class nurbs.Nurbs
java.lang.Object
|
+----nurbs.Nurbs
public class Nurbs
extends Object
implements Cloneable
NURBS curve and surface
controlNet
u
v
Nurbs (Knot, Knot, ControlNet)
NURBS Constructor.
clone ()
Performs a deep copy of this NURBS.
elevate ()
Increase the order of this NURBS
extrude (Point4)
Perform a linear extrusion of this NURBS along the vector w
to produce a new NURBS.
getNumUControlPoints ()
Access the number of U control points.
getNumUKnots ()
Access the number of U knots.
getNumVControlPoints ()
Access the number of V control points.
getNumVKnots ()
Access the number of V knots.
getUKnot ()
Access the U knot sequence.
getUOrder ()
Access the NURB order in U.
getVKnot ()
Access the V knot sequence.
getVOrder ()
Access the NURB order in V.
revolve (float, float)
Do a surface of revolution about the Y axis.
rotate (float, float, float, float)
Rotate this NURBS.
scale (float)
Scale this NURBS uniformly.
scale (float, float, float)
Scale this NURBS non-uniformly.
setControlNet (ControlNet)
Set the ControlNet.
setUKnot (Knot)
Set the U knot sequence.
setVKnot (Knot)
Set the V knot sequence.
split (float)
Split this NURBS into two at the given location.
subdivide (Nurbs, int, int)
Calculates the control points corresponding to new knots.
tessellate (int, int)
Refine this NURBS in the U and V directions by inserting
new knots and control points.
toString ()
Creates a String representation for the NURBS
toVRMLCoordinateNode ()
Creates a String representation for the NURBS
in the form of a VRML Coordinate node.
toVRMLCoordIndex ()
Creates a String representation for the NURBS
in the form of a VRML coordIndex field.
toVRMLString ()
Creates a String representation for the NURBS
in the form of a VRML Coordinate node.
translate (float, float, float)
Translate this NURBS.
transpose ()
Transpose this NURBS by swapping U and V.
u
protected Knot u
v
protected Knot v
controlNet
protected ControlNet controlNet
Nurbs
public Nurbs(Knot u,
Knot v,
ControlNet controlNet)
NURBS Constructor.
Parameters:
u - the U knot sequence
v - the V knot sequence
controlNet - the array of Point4 control points
Throws: IllegalArgumentException
when the
clone
public Object clone()
Performs a deep copy of this NURBS.
Returns:
a new instance of Nurbs
Overrides:
clone in class Object
getNumUKnots
public int getNumUKnots()
Access the number of U knots.
Returns:
the number of U knots
getNumVKnots
public int getNumVKnots()
Access the number of V knots.
Returns:
the number of V knots
getUOrder
public int getUOrder()
Access the NURB order in U.
Returns:
the order in U of the NURB
getVOrder
public int getVOrder()
Access the NURB order in V.
Returns:
the order in V of the NURB
getNumUControlPoints
public int getNumUControlPoints()
Access the number of U control points.
Returns:
the number of U control points
getNumVControlPoints
public int getNumVControlPoints()
Access the number of V control points.
Returns:
the number of V control points
getUKnot
public Knot getUKnot()
Access the U knot sequence.
Returns:
the U knot sequence
getVKnot
public Knot getVKnot()
Access the V knot sequence.
Returns:
the V knot sequence
setUKnot
public void setUKnot(Knot u)
Set the U knot sequence.
Parameters:
u - the new U knot sequence
setVKnot
public void setVKnot(Knot v)
Set the V knot sequence.
Parameters:
v - the new V knot sequence
setControlNet
public void setControlNet(ControlNet controlNet)
Set the ControlNet.
Parameters:
controlNet - the new ControlNet
scale
public void scale(float scale)
Scale this NURBS uniformly.
Parameters:
scale - the scale
scale
public void scale(float xscale,
float yscale,
float zscale)
Scale this NURBS non-uniformly.
Parameters:
scale - the scale
translate
public void translate(float x,
float y,
float z)
Translate this NURBS.
Parameters:
x - the translation in X
y - the translation in Y
z - the translation in Z
rotate
public void rotate(float x,
float y,
float z,
float theta)
Rotate this NURBS.
Parameters:
x - the X component of the rotation axis
y - the Y component of the rotation axis
z - the Z component of the rotation axis
theta - the rotation in radians
transpose
public void transpose()
Transpose this NURBS by swapping U and V.
tessellate
public Nurbs tessellate(int uSegments,
int vSegments)
Refine this NURBS in the U and V directions by inserting
new knots and control points.
Employs recursive subdivision using the Oslo algorithm.
Refinement is done through recursive subdivision by adding
uSegments knots in the U direction and vSegments knots in
the V direction. (This also adds uSegments*vSegments
control points since the order remains constant.)
Parameters:
uSegments - the number of new control points
vSegments - the number of new control points
Returns:
the refined Nurbs
subdivide
protected void subdivide(Nurbs temp,
int oldKnotIndex,
int newKnotIndex)
Calculates the control points corresponding to new knots.
This is called once for each new knot and creates
numVControlPoints new control points.
Parameters:
temp - the Nurbs which will contain the new control points
oldKnotIndex - the index of the old knot
newKnotIndex - the index of the new knot
split
protected Nurbs [] split(float dottedline)
Split this NURBS into two at the given location.
Parameters:
dottedline - the knot parameter at which to cut
Returns:
an array of two Nurbs objects
extrude
public Nurbs extrude(Point4 w)
Perform a linear extrusion of this NURBS along the vector w
to produce a new NURBS. Leaves this instance unchanged.
If this Nurbs instance is a surface, extrude the v.knot[0]
curve only.
Returns:
a Nurbs surface.
revolve
public Nurbs revolve(float thetamin,
float thetamax)
Do a surface of revolution about the Y axis.
Assumes curve is in X-Y plane
The profile NURBS will first be projected onto the Z=0 plane,
the resulting projection will be revolved about the Y axis.
Currently, thetamin and thetamax are ignored and 0, 2*PI is
used in all cases.
Parameters:
thetamin - the angle at which to start the revolution
thetamax - the angle at which to end the revolution
Returns:
a Nurbs surface.
elevate
public Nurbs elevate()
Increase the order of this NURBS
Returns:
the elevated Nurbs
toVRMLString
public String toVRMLString()
Creates a String representation for the NURBS
in the form of a VRML Coordinate node.
Returns:
a string representation of the Nurbs
toVRMLCoordinateNode
public String toVRMLCoordinateNode()
Creates a String representation for the NURBS
in the form of a VRML Coordinate node.
Returns:
a string representation of the Nurbs
toVRMLCoordIndex
public int[] toVRMLCoordIndex()
Creates a String representation for the NURBS
in the form of a VRML coordIndex field.
Returns:
a string representation of the Nurbs
toString
public String toString()
Creates a String representation for the NURBS
Returns:
a string representation of the Nurbs
Overrides:
toString in class Object
All Packages Class Hierarchy This Package Previous Next Index