public abstract class NurbsCurve extends AbstractCurve<NurbsCurve>
Modified by: Joseph A. Huwaldt
GTOL
RESOURCES
Constructor and Description |
---|
NurbsCurve() |
Modifier and Type | Method and Description |
---|---|
Parameter<Length> |
getArcLength(double eps)
Return the total arc length of this curve.
|
Parameter<Length> |
getArcLength(double s1,
double s2,
double eps)
Return the arc length of a segment of this curve.
|
abstract java.util.List<ControlPoint> |
getControlPoints()
Return a list of control points for this curve.
|
abstract int |
getDegree()
Return the degree of the NURBS curve.
|
abstract KnotVector |
getKnotVector()
Return the knot vector of this curve.
|
NurbsCurveTrans |
getTransformed(GTransform transform)
Returns transformed version of this element.
|
PointString<SubrangePoint> |
gridToTolerance(Parameter<Length> tol)
Return a string of points that are gridded onto the curve with the number of points
and spacing chosen to result in straight line segments between the points that have
mid-points that are all within the specified tolerance of this curve.
|
abstract BasicNurbsCurve |
immutable()
Return an immutable version of this NURBS curve.
|
BasicNurbsCurve |
insertKnot(double s,
int numInsertions)
Create and return a new
NURBS curve that is geometrically
identical to this one but with a new knot inserted at the specified parametric
location. |
GeomList<PointString<SubrangePoint>> |
intersect(LineSegment line,
Parameter<Length> tol)
Return the intersection between a line segment and this curve.
|
boolean |
isDegenerate(Parameter<Length> tol)
Return
true if this curve is degenerate (i.e.: has length less than
the specified tolerance). |
boolean |
isLine(Parameter<Length> tol)
Returns
true if this curve is a line to within the specified
tolerance. |
boolean |
isPlanar(Parameter<Length> tol)
Return
true if this curve is planar or false if it is
not. |
boolean |
isValid()
Return
true if this NurbsCurve contains valid and finite numerical
components. |
NurbsCurve |
mergeKnotVector(Float64Vector Um)
Return a
NURBS curve that is geometrically identical to
this one but with the specified list of knots merged into it's knot vector. |
BasicNurbsCurve |
refineKnotVector(double[] newKnots)
Create and return a new
NURBS curve that is geometrically
identical to this one but with the specified list of knots inserted into it's knot
vector. |
BasicNurbsCurve |
refineKnotVector(Float64Vector newKnots)
Create and return a new
NURBS curve that is geometrically
identical to this one but with the specified list of knots inserted into it's knot
vector. |
NurbsCurve |
removeKnot(int index,
int numRemovals,
Parameter<Length> tolerance)
Attempts to remove the knot with the specified index from this NURBS curve the
specified number of times.
|
NurbsCurve |
reverse()
Return a new curve that is identical to this one, but with the parameterization
reversed.
|
GeomList<NurbsCurve> |
splitAt(double s)
Split this
NurbsCurve at the specified parametric position returning a list
containing two curves (a lower curve with smaller parametric positions than "s" and
an upper curve with larger parametric positions). |
NurbsCurve |
toNurbs()
Return a NURBS curve representation of this curve.
|
NurbsCurve |
toNurbs(Parameter<Length> tol)
Return a NURBS curve representation of this curve to within the specified
tolerance.
|
javolution.text.Text |
toText()
Returns the text representation of this geometry element that consists of the name
followed by the control point values, followed by the knot vector.
|
extractGrid, getArcLength, getBinormal, getBinormal, getClosest, getClosest, getClosest, getClosest, getClosest, getClosest, getCurvature, getCurvature, getDerivatives, getEnclosedArea, getFarthest, getFarthest, getFarthest, getLimitPoint, getParDimension, getPoint, getPoint, getPointAtArcLength, getPrincipalNormal, getPrincipalNormal, getRealPoint, getSDerivative, getSDerivatives, getTangencyPoint, getTangent, getTangent, getTorsion, getTorsion, getVariationOfCurvature, getVariationOfCurvature, intersect, intersect, intersect, intersect, isCircular, splitAt
addChangeListener, clone, compareTo, equals, getAllUserData, getID, getName, getUserData, hashCode, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString
copy, copyToReal, getRealPoint, getSDerivatives, to, toDimension
addChangeListener, getAllUserData, getBoundsMax, getBoundsMin, getID, getName, getPhyDimension, getUnit, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, size
public NurbsCurve()
public abstract java.util.List<ControlPoint> getControlPoints()
public abstract KnotVector getKnotVector()
public abstract int getDegree()
public abstract BasicNurbsCurve immutable()
public NurbsCurve reverse()
public BasicNurbsCurve insertKnot(double s, int numInsertions)
NURBS curve
that is geometrically
identical to this one but with a new knot inserted at the specified parametric
location. The parameterization of the new curve is identical to this curve, but the
new curve will have a new knot at the specified location and a new set of control
points.s
- The parametric location where the knot is to be inserted.numInsertions
- The number of times that the knot should be inserted at the
specified position.public BasicNurbsCurve refineKnotVector(double[] newKnots)
NURBS curve
that is geometrically
identical to this one but with the specified list of knots inserted into it's knot
vector. The parameterization of the new curve is identical to this curve, but the
new curve will have the new knots at the specified locations and a new set of
control points. This is more efficient than repeatedly calling insertKnot() for
multiple knot insertions.newKnots
- The parametric locations where the knots are to be inserted.public BasicNurbsCurve refineKnotVector(Float64Vector newKnots)
NURBS curve
that is geometrically
identical to this one but with the specified list of knots inserted into it's knot
vector. The parameterization of the new curve is identical to this curve, but the
new curve will have the new knots at the specified locations and a new set of
control points. This is more efficient than repeatedly calling insertKnot() for
multiple knot insertions.newKnots
- The parametric locations where the knots are to be inserted. May
not be null.public NurbsCurve mergeKnotVector(Float64Vector Um)
NURBS curve
that is geometrically identical to
this one but with the specified list of knots merged into it's knot vector. The
parameterization of the new curve is identical to this curve, but the new curve
will have any new knots at the specified locations added and a new set of control
points. If the input knot list matches the knot list of this curve, then this curve
is returned.Um
- The knot vector to merge with this curve's knot vector. May not be null.public NurbsCurve removeKnot(int index, int numRemovals, Parameter<Length> tolerance)
if (crv == crv.removeKnot(...)) { no knots removed }
.index
- The index of the knot to be removed (degree + 1 ≤ index <
knot vector length - degree).numRemovals
- The number of times that the knot at "index" should be removed
(1 ≤ num ≤ multiplicity of the knot). If numRemovals is >
multiplicity of the knot, then numRemovals is set to the
multiplicity of the knot.tolerance
- The knot(s) specified will be removed as long as the deviation
of the curve is everywhere less than this tolerance. May not be
null.public Parameter<Length> getArcLength(double eps)
getArcLength
in interface Curve<NurbsCurve>
getArcLength
in class AbstractCurve<NurbsCurve>
eps
- The desired fractional accuracy on the arc-length.public Parameter<Length> getArcLength(double s1, double s2, double eps)
getArcLength
in interface Curve<NurbsCurve>
getArcLength
in class AbstractCurve<NurbsCurve>
s1
- The starting parametric distance along the curve to begin the arc-length
calculation from.s2
- The ending parametric distance along the curve to end the arc-length
calculation at.eps
- The desired fractional accuracy on the arc-length.public PointString<SubrangePoint> gridToTolerance(Parameter<Length> tol)
gridToTolerance
in interface Curve<NurbsCurve>
gridToTolerance
in class AbstractCurve<NurbsCurve>
tol
- The maximum distance that a straight line between gridded points may
deviate from this curve. May not be null.public NurbsCurveTrans getTransformed(GTransform transform)
GeomTransform
and contains this element as a child.transform
- The transformation to apply to this geometry. May not be null.DimensionException
- if this point is not 3D.public GeomList<NurbsCurve> splitAt(double s)
NurbsCurve
at the specified parametric position returning a list
containing two curves (a lower curve with smaller parametric positions than "s" and
an upper curve with larger parametric positions).s
- The parametric position where this curve should be split (must not be 0 or
1!).public GeomList<PointString<SubrangePoint>> intersect(LineSegment line, Parameter<Length> tol)
intersect
in interface Curve<NurbsCurve>
intersect
in class AbstractCurve<NurbsCurve>
line
- The line segment to intersect. May not be null.tol
- Tolerance (in physical space) to refine the point positions to. May not be null.public NurbsCurve toNurbs(Parameter<Length> tol)
tol
- Ignored. May pass null
.public NurbsCurve toNurbs()
public boolean isValid()
true
if this NurbsCurve contains valid and finite numerical
components. A value of false
will be returned if any of the control
point values or knots are NaN or Inf.public boolean isDegenerate(Parameter<Length> tol)
true
if this curve is degenerate (i.e.: has length less than
the specified tolerance).isDegenerate
in interface Curve<NurbsCurve>
isDegenerate
in interface ParametricGeometry<NurbsCurve>
isDegenerate
in class AbstractCurve<NurbsCurve>
tol
- The tolerance for determining if this curve is degenerate. May not be null.getArcLength(double)
public boolean isLine(Parameter<Length> tol)
true
if this curve is a line to within the specified
tolerance.isLine
in interface Curve<NurbsCurve>
isLine
in class AbstractCurve<NurbsCurve>
tol
- The tolerance for determining if this curve is a line. If null is
passed, then exact linearity is required.public boolean isPlanar(Parameter<Length> tol)
true
if this curve is planar or false
if it is
not.isPlanar
in interface Curve<NurbsCurve>
isPlanar
in class AbstractCurve<NurbsCurve>
tol
- The geometric tolerance to use in determining if the curve is planar.
May not be null.public javolution.text.Text toText()
{aCurve = {{{1 ft, 0 ft}, 1.0}, {{0 ft, 1 ft}, 0.25}, {{-1 ft, 0 ft}, 1.0}},{degree=2,{0.0, 0.0, 0.0, 1.0, 1.0, 1.0}}}If there is no name, then the output looks like this:
{{{{1 ft, 0 ft}, 1.0}, {{0 ft, 1 ft}, 0.25}, {{-1 ft, 0 ft}, 1.0}},{degree=2,{0.0, 0.0, 0.0, 1.0, 1.0, 1.0}}}
toText
in interface GeomElement<NurbsCurve>
toText
in class AbstractGeomElement<NurbsCurve>