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

Variable Index

 o controlNet
 o u
 o v

Constructor Index

 o Nurbs(Knot, Knot, ControlNet)
NURBS Constructor.

Method Index

 o clone()
Performs a deep copy of this NURBS.
 o elevate()
Increase the order of this NURBS
 o extrude(Point4)
Perform a linear extrusion of this NURBS along the vector w to produce a new NURBS.
 o getNumUControlPoints()
Access the number of U control points.
 o getNumUKnots()
Access the number of U knots.
 o getNumVControlPoints()
Access the number of V control points.
 o getNumVKnots()
Access the number of V knots.
 o getUKnot()
Access the U knot sequence.
 o getUOrder()
Access the NURB order in U.
 o getVKnot()
Access the V knot sequence.
 o getVOrder()
Access the NURB order in V.
 o revolve(float, float)
Do a surface of revolution about the Y axis.
 o rotate(float, float, float, float)
Rotate this NURBS.
 o scale(float)
Scale this NURBS uniformly.
 o scale(float, float, float)
Scale this NURBS non-uniformly.
 o setControlNet(ControlNet)
Set the ControlNet.
 o setUKnot(Knot)
Set the U knot sequence.
 o setVKnot(Knot)
Set the V knot sequence.
 o split(float)
Split this NURBS into two at the given location.
 o subdivide(Nurbs, int, int)
Calculates the control points corresponding to new knots.
 o tessellate(int, int)
Refine this NURBS in the U and V directions by inserting new knots and control points.
 o toString()
Creates a String representation for the NURBS
 o toVRMLCoordinateNode()
Creates a String representation for the NURBS in the form of a VRML Coordinate node.
 o toVRMLCoordIndex()
Creates a String representation for the NURBS in the form of a VRML coordIndex field.
 o toVRMLString()
Creates a String representation for the NURBS in the form of a VRML Coordinate node.
 o translate(float, float, float)
Translate this NURBS.
 o transpose()
Transpose this NURBS by swapping U and V.

Variables

 o u
  protected Knot u
 o v
  protected Knot v
 o controlNet
  protected ControlNet controlNet

Constructors

 o 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

Methods

 o clone
  public Object clone()
Performs a deep copy of this NURBS.
Returns:
a new instance of Nurbs
Overrides:
clone in class Object
 o getNumUKnots
  public int getNumUKnots()
Access the number of U knots.
Returns:
the number of U knots
 o getNumVKnots
  public int getNumVKnots()
Access the number of V knots.
Returns:
the number of V knots
 o getUOrder
  public int getUOrder()
Access the NURB order in U.
Returns:
the order in U of the NURB
 o getVOrder
  public int getVOrder()
Access the NURB order in V.
Returns:
the order in V of the NURB
 o getNumUControlPoints
  public int getNumUControlPoints()
Access the number of U control points.
Returns:
the number of U control points
 o getNumVControlPoints
  public int getNumVControlPoints()
Access the number of V control points.
Returns:
the number of V control points
 o getUKnot
  public Knot getUKnot()
Access the U knot sequence.
Returns:
the U knot sequence
 o getVKnot
  public Knot getVKnot()
Access the V knot sequence.
Returns:
the V knot sequence
 o setUKnot
  public void setUKnot(Knot u)
Set the U knot sequence.
Parameters:
u - the new U knot sequence
 o setVKnot
  public void setVKnot(Knot v)
Set the V knot sequence.
Parameters:
v - the new V knot sequence
 o setControlNet
  public void setControlNet(ControlNet controlNet)
Set the ControlNet.
Parameters:
controlNet - the new ControlNet
 o scale
  public void scale(float scale)
Scale this NURBS uniformly.
Parameters:
scale - the scale
 o scale
  public void scale(float xscale,
                    float yscale,
                    float zscale)
Scale this NURBS non-uniformly.
Parameters:
scale - the scale
 o 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
 o 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
 o transpose
  public void transpose()
Transpose this NURBS by swapping U and V.
 o 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
 o 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
 o 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
 o 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.
 o 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.
 o elevate
  public Nurbs elevate()
Increase the order of this NURBS
Returns:
the elevated Nurbs
 o 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
 o 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
 o 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
 o 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