public class NURBSCurve3d extends NURBSCurveBase
CLOSED, init, OPEN
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
NURBSCurve3d()
Creates an empty NURBS curve.
|
NURBSCurve3d(int d,
int type,
Vector4d[] ctrlPnts,
double[] knots)
Creates an open or closed NURBS curve with a specified degree, knots, and
control points.
|
Modifier and Type | Method and Description |
---|---|
void |
eval(Point3d pnt,
double u)
Evaluates the point on this curve for parameter u.
|
Point3d[] |
evalPoints(int npnts)
Returns a set of points evaluated along the curve at intervals which are
evenly spaced with respect to the curve parameter.
|
double |
findPoint(Point3d pnt,
double umin,
double umax)
Finds a u value for a given curve point within a specified interval of the
curve.
|
void |
set(NURBSCurve3d curve) |
addControlPoint, computeControlPolygonLength, convertToBezier, createRenderProps, createUniformKnots, getDegree, getKnot, getKnotIndex, getKnots, getRange, getResolution, getType, insertKnot, isBezier, isBSpline, isClosed, numKnots, read, read, removeControlPoint, render, reset, set, set, set, setBezier, setCircle, setRange, setResolution, setUniformCubic, write, write
controlPointIsSelected, getControlPoint, getControlPoints, getDrawControlShape, getLineWidth, getObjToWorld, getObjToWorld, getPointSize, getRenderHints, getRenderProps, getSelection, isSelectable, numControlPoints, numSelectionQueriesNeeded, prerender, render, selectControlPoint, setDrawControlShape, setLineWidth, setObjToWorld, setPointSize, setRenderProps, transform, updateBounds, write, write
public NURBSCurve3d()
public NURBSCurve3d(int d, int type, Vector4d[] ctrlPnts, double[] knots)
set
.d
- degree of the curvetype
- curve type, which must be either OPEN
or
CLOSED
.ctrlPnts
- control pointsknots
- knot valuesjava.lang.IllegalArgumentException
- if constraints on the arguments are violatedNURBSCurveBase.set(int,int,Vector4d[],double[])
public Point3d[] evalPoints(int npnts)
npnts
- number of points to createpublic void eval(Point3d pnt, double u)
eval
in class NURBSCurveBase
pnt
- returns the curve point valueu
- curve parameter valuepublic double findPoint(Point3d pnt, double umin, double umax)
This routine uses an iterative golden section search, and so is not particularly fast.
pnt
- point to search forumin
- minimum u valu for the intervalumax
- maximum u valu for the intervalpublic void set(NURBSCurve3d curve)