|
AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Represents a NURBS curve defined by an array of control points, weights and knots. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/main/src/axom/primal/geometry/NURBSCurve.hpp>
Public Types | |
| using | NumericType = T |
| using | PointType = Point< T, NDIMS > |
| using | VectorType = Vector< T, NDIMS > |
| using | SegmentType = Segment< T, NDIMS > |
| using | WeightsVec = axom::Array< T > |
| using | CoordsVec = axom::Array< PointType > |
| using | KnotVectorType = KnotVector< T > |
| using | BoundingBoxType = BoundingBox< T, NDIMS > |
| using | OrientedBoundingBoxType = OrientedBoundingBox< T, NDIMS > |
Public Member Functions | |
| std::ostream & | print (std::ostream &os) const |
| Simple formatted print of a NURBS Curve instance. More... | |
Query/modify curve properties (degree, rationality, ...) | |
| void | setParameters (int npts, int degree) |
| Reset the degree and resize arrays of points (and weights) More... | |
| void | setDegree (int degree) |
| Reset the knot vector. More... | |
| int | getDegree () const |
| Returns the degree of the NURBS Curve. More... | |
| int | getOrder () const |
| Returns the order of the NURBS Curve. More... | |
| int | getNumControlPoints () const |
| Returns the number of control points in the NURBS Curve. More... | |
| void | setNumControlPoints (int npts) |
| Set the number control points. More... | |
| void | clear () |
| Clears the list of control points, make nonrational. More... | |
| bool | isRational () const |
| Use array size as flag for rationality. More... | |
| void | makeRational () |
| Make trivially rational. If already rational, do nothing. More... | |
| void | makeNonrational () |
| Make nonrational. If already rational, do nothing. More... | |
| bool | isValidNURBS () const |
| Function to check if the NURBS curve is valid. More... | |
Query/modify curve's geometry (control points, weights, bounding box, ...) | |
| PointType & | operator[] (int idx) |
| Retrieve the control point at index idx. More... | |
| const PointType & | operator[] (int idx) const |
| Retrieve the control point at index idx. More... | |
| const PointType & | getInitPoint () const |
| const PointType & | getEndPoint () const |
| CoordsVec & | getControlPoints () |
| Returns a reference to the NURBS curve's control points. More... | |
| const CoordsVec & | getControlPoints () const |
| Returns a const reference to the NURBS curve's control points. More... | |
| const T & | getWeight (int idx) const |
| Get a specific weight. More... | |
| void | setWeight (int idx, T weight) |
| Set the weight at a specific index. More... | |
| WeightsVec & | getWeights () |
| Returns a reference to the NURBS curve's weights. More... | |
| const WeightsVec & | getWeights () const |
| Returns a const reference to the NURBS curve's weights. More... | |
| BoundingBoxType | boundingBox () const |
| Returns an axis-aligned bounding box containing the NURBS curve. More... | |
| OrientedBoundingBoxType | orientedBoundingBox () const |
| Returns an oriented bounding box containing the NURBS curve. More... | |
Query/modify curve parametrization | |
| axom::IndexType | getNumKnots () const |
| Returns the number of knots in the NURBS Curve. More... | |
| auto | getNumKnotSpans () const |
| void | normalize () |
| Normalize the knot vector to the span of [0, 1]. More... | |
| void | rescale (T a, T b) |
| Rescale the knot vector to the span of [a, b]. More... | |
| const T & | getKnot (int idx) const |
| Get a specific knot value. More... | |
| void | setKnot (int idx, T knot) |
| Set the knot value at a specific index. More... | |
| void | setKnots (const axom::Array< T > &knots, int degree) |
| Set the knot vector by an axom::Array. More... | |
| void | setKnots (const KnotVectorType &knotVector) |
| Set the knot vector by a KnotVector object. More... | |
| KnotVectorType & | getKnots () |
| Return a reference to the knot vector. More... | |
| const KnotVectorType & | getKnots () const |
| Return a const reference to the knot vector. More... | |
| T | getMinKnot () const |
| Get minimum knot value. More... | |
| T | getMaxKnot () const |
| Get maximum knot value. More... | |
| void | reverseOrientation () |
| Reverses the order of the NURBS curve's control points and weights. More... | |
| axom::IndexType | insertKnot (T t, int target_multiplicity=1) |
| Insert a knot with given multiplicity. More... | |
Functions to evaluate curve and its derivatives and normals | |
| PointType | evaluate (T t) const |
| Evaluate a NURBS Curve at a particular parameter value t. More... | |
| VectorType | dt (T t) const |
| Evaluate the first derivative of NURBS Curve at parameter t. More... | |
| VectorType | dtdt (T t) const |
| Evaluate the second derivative of NURBS Curve at parameter t. More... | |
| void | evaluateFirstDerivative (T t, PointType &eval, VectorType &Dt) const |
| Evaluate the curve and the first derivative at parameter t. More... | |
| void | evaluateSecondDerivative (T t, PointType &eval, VectorType &Dt, VectorType &DtDt) const |
| Evaluate the curve and the first two derivatives at parameter t. More... | |
| void | evaluateDerivatives (T t, int d, PointType &eval, axom::Array< VectorType > &ders) const |
| Evaluate the curve and the first d derivatives at parameter t. More... | |
Functions dealing with curve subdivision | |
| bool | split (T t, NURBSCurve< T, NDIMS > &n1, NURBSCurve< T, NDIMS > &n2, bool normalizeParameters=false) const |
| Splits a NURBS curve into two curves at a given parameter value. More... | |
| void | bisect (NURBSCurve< T, NDIMS > &n1, NURBSCurve< T, NDIMS > &n2, bool normalizeParameters=false) const |
| Splits a NURBS curve into two curves at the middle parameter value. More... | |
| axom::Array< BezierCurve< T, NDIMS > > | extractBezier () const |
| Splits a NURBS curve (at each internal knot) into several Bezier curves. More... | |
Friends | |
| bool | operator== (const NURBSCurve< T, NDIMS > &lhs, const NURBSCurve< T, NDIMS > &rhs) |
| Equality operator for NURBS Curves. More... | |
| bool | operator!= (const NURBSCurve< T, NDIMS > &lhs, const NURBSCurve< T, NDIMS > &rhs) |
| Inequality operator for NURBS Curves. More... | |
Constructors for NURBSCurve | |
The constructors allow for flexible initialization of NURBSCurve objects from:
All require:
| |
| NURBSCurve (int degree=-1) | |
| Constructor for a simple NURBS curve that reserves space for the minimum (sensible) number of points for the given degree. More... | |
| NURBSCurve (int npts, int degree) | |
| Constructor for a NURBS curve with given number of control points and degree. More... | |
| NURBSCurve (axom::ArrayView< const PointType > pts, axom::ArrayView< const T > weights, const KnotVectorType &knotVector) | |
| Constructor for a NURBS Curve with ArrayViews of control points and weights and a KnotVector. More... | |
| NURBSCurve (axom::ArrayView< PointType > pts, axom::ArrayView< T > weights, const KnotVectorType &knotVector) | |
| Constructs a NURBSCurve from arrays of control points, weights and knots. More... | |
| NURBSCurve (const BezierCurve< T, NDIMS > &bezierCurve) | |
| Constructor for a NURBS curve from a Bezier curve. More... | |
| NURBSCurve (const PointType *pts, int npts, int degree) | |
| Constructor for a NURBS Curve with control points and degree. More... | |
| NURBSCurve (const PointType *pts, const T *weights, int npts, int degree) | |
| Constructor for a NURBS Curve with control points, weights, and degree. More... | |
| NURBSCurve (const PointType *pts, int npts, const T *knots, int nkts) | |
| Constructor for a NURBS Curve with control points and knots. More... | |
| NURBSCurve (const PointType *pts, const T *weights, int npts, const T *knots, int nkts) | |
| Constructor for a NURBS Curve with control points, weights, and knots. More... | |
| NURBSCurve (const axom::Array< PointType > &pts, int degree) | |
| Constructor for a NURBS Curve of the specified degree from an array of control points. More... | |
| NURBSCurve (const axom::Array< PointType > &pts, const axom::Array< T > &weights, int degree) | |
| Constructor for a NURBS Curve of the specified degree from an array of control points and weights. More... | |
| NURBSCurve (const axom::Array< PointType > &pts, const axom::Array< T > &knots) | |
| Constructor for a NURBS Curve with axom arrays of nodes and knots. More... | |
| NURBSCurve (const axom::Array< PointType > &pts, const axom::Array< T > &weights, const axom::Array< T > &knots) | |
| Constructor for a NURBS Curve with axom arrays of nodes, weights, and knots. More... | |
| NURBSCurve (const axom::Array< PointType > &pts, const KnotVectorType &knotVector) | |
| Constructor from axom array of nodes and KnotVector object. More... | |
| NURBSCurve (const axom::Array< PointType > &pts, const axom::Array< T > &weights, const KnotVectorType &knotVector) | |
| Constructor from axom array of nodes, weights, and KnotVector object. More... | |
| static NURBSCurve | make_circular_arc_nurbs (T theta_0, T theta_1, T u, T v, T radius) |
| Construct a multi-span, rational, degree 2 NURBS curve from the angles of a circular arc. More... | |
| static NURBSCurve | make_linear_segment_nurbs (const PointType &start, const PointType &end) |
| Construct a NURBS curve from the endpoints of a line segment. More... | |
Represents a NURBS curve defined by an array of control points, weights and knots.
| T | the coordinate type, e.g., double, float, etc. |
| NDIMS | the number of dimensions |
A NURBS curve has degree p, n+1 control points, optionally n+1 weights, and a knot vector of length k+1. A valid curve has k+1 = n+p+2 The curve must be open (clamped on each end) and continuous (unless p = 0)
Polynomial (Nonrational) NURBS curves are identified by an empty weights array.
| using axom::primal::NURBSCurve< T, NDIMS >::NumericType = T |
| using axom::primal::NURBSCurve< T, NDIMS >::PointType = Point<T, NDIMS> |
| using axom::primal::NURBSCurve< T, NDIMS >::VectorType = Vector<T, NDIMS> |
| using axom::primal::NURBSCurve< T, NDIMS >::SegmentType = Segment<T, NDIMS> |
| using axom::primal::NURBSCurve< T, NDIMS >::WeightsVec = axom::Array<T> |
| using axom::primal::NURBSCurve< T, NDIMS >::CoordsVec = axom::Array<PointType> |
| using axom::primal::NURBSCurve< T, NDIMS >::KnotVectorType = KnotVector<T> |
| using axom::primal::NURBSCurve< T, NDIMS >::BoundingBoxType = BoundingBox<T, NDIMS> |
| using axom::primal::NURBSCurve< T, NDIMS >::OrientedBoundingBoxType = OrientedBoundingBox<T, NDIMS> |
|
inlineexplicit |
Constructor for a simple NURBS curve that reserves space for the minimum (sensible) number of points for the given degree.
| [in] | deg | the degree of the resulting curve |
|
inline |
Constructor for a NURBS curve with given number of control points and degree.
| [in] | npts | the number of control points |
| [in] | degree | the degree of the curve |
References axom::primal::NURBSCurve< T, NDIMS >::isValidNURBS(), axom::Array< T, DIM, SPACE, StoragePolicy >::resize(), and SLIC_ASSERT.
|
inline |
Constructor for a NURBS Curve with ArrayViews of control points and weights and a KnotVector.
| [in] | pts | ArrayView of control points |
| [in] | weights | ArrayView of weights |
| [in] | knotVector | The knot vector object |
For clamped and continuous curves, the control points and knot vector uniquely determine the degree
References axom::ArrayView< T, DIM, SPACE >::data(), axom::ArrayView< T, DIM, SPACE >::empty(), axom::primal::KnotVector< T >::getDegree(), axom::primal::KnotVector< T >::isValid(), axom::primal::NURBSCurve< T, NDIMS >::isValidNURBS(), axom::primal::NURBSCurve< T, NDIMS >::makeNonrational(), axom::ArrayView< T, DIM, SPACE >::size(), and SLIC_ASSERT.
|
inline |
Constructs a NURBSCurve from arrays of control points, weights and knots.
|
inlineexplicit |
Constructor for a NURBS curve from a Bezier curve.
| [in] | bezierCurve | the Bezier curve to convert to a NURBS curve |
|
inline |
Constructor for a NURBS Curve with control points and degree.
| [in] | pts | the control points of the curve |
| [in] | npts | the number of control points |
| [in] | degree | the degree of the curve |
|
inline |
Constructor for a NURBS Curve with control points, weights, and degree.
| [in] | pts | the control points of the curve |
| [in] | weights | the weights of the control points |
| [in] | npts | the number of control points and weights |
| [in] | degree | the degree of the curve |
|
inline |
Constructor for a NURBS Curve with control points and knots.
| [in] | pts | the control points of the curve |
| [in] | npts | the number of control points and weights |
| [in] | knots | the weights of the control points |
| [in] | nkts | the length of the knot vector |
|
inline |
Constructor for a NURBS Curve with control points, weights, and knots.
| [in] | pts | the control points of the curve |
| [in] | weights | the weights of the control points |
| [in] | npts | the number of control points and weights |
| [in] | knots | the weights of the control points |
| [in] | nkts | the length of the knot vector |
|
inline |
Constructor for a NURBS Curve of the specified degree from an array of control points.
| [in] | pts | the control points of the curve |
| [in] | degree | the degree of the curve |
|
inline |
Constructor for a NURBS Curve of the specified degree from an array of control points and weights.
| [in] | pts | the control points of the curve |
| [in] | weights | the weights of the control points |
| [in] | degree | the degree of the curve |
|
inline |
Constructor for a NURBS Curve with axom arrays of nodes and knots.
| [in] | pts | the control points of the curve |
| [in] | knots | the knot vector of the curve |
|
inline |
Constructor for a NURBS Curve with axom arrays of nodes, weights, and knots.
| [in] | pts | the control points of the curve |
| [in] | weights | the weights of the control points |
| [in] | knots | the knot vector of the curve |
|
inline |
Constructor from axom array of nodes and KnotVector object.
| [in] | pts | the control points of the curve |
| [in] | knotVector | A KnotVector object |
|
inline |
Constructor from axom array of nodes, weights, and KnotVector object.
| [in] | pts | the control points of the curve |
| [in] | weights | the weights of the control points |
| [in] | knotVector | A KnotVector object |
|
inlinestatic |
Construct a multi-span, rational, degree 2 NURBS curve from the angles of a circular arc.
| [in] | theta_0 | The starting angle of the arc |
| [in] | theta_1 | The ending angle of the arc |
| [in] | u,v | The center of the 2D circle |
| [in] | radius | The radius of the circle |
theta_1 < theta_0, in which case the arc is clockwise.References axom::utilities::ceil(), axom::primal::NURBSCurve< T, NDIMS >::makeRational(), axom::utilities::min(), axom::primal::NURBSCurve< T, NDIMS >::NURBSCurve(), axom::primal::NURBSCurve< T, NDIMS >::reverseOrientation(), axom::primal::NURBSCurve< T, NDIMS >::setKnot(), axom::primal::NURBSCurve< T, NDIMS >::setWeight(), SLIC_ASSERT, and axom::utilities::swap().
|
inlinestatic |
Construct a NURBS curve from the endpoints of a line segment.
| [in] | start | The starting point of the arc |
| [in] | end | The ending point of the arc |
References axom::utilities::annotations::end(), and SLIC_ASSERT.
|
inline |
Reset the degree and resize arrays of points (and weights)
| [in] | npts | The target number of control points |
| [in] | degree | The target degree |
References axom::primal::NURBSCurve< T, NDIMS >::isRational(), axom::primal::KnotVector< T >::makeUniform(), axom::Array< T, DIM, SPACE, StoragePolicy >::resize(), and SLIC_ASSERT.
|
inline |
Reset the knot vector.
| [in] | degree | The target degree |
References axom::primal::NURBSCurve< T, NDIMS >::getNumControlPoints(), axom::primal::KnotVector< T >::makeUniform(), and SLIC_ASSERT.
|
inline |
Returns the degree of the NURBS Curve.
References axom::primal::KnotVector< T >::getDegree().
|
inline |
Returns the order of the NURBS Curve.
References axom::primal::KnotVector< T >::getDegree().
|
inline |
Returns the number of control points in the NURBS Curve.
References axom::Array< T, DIM, SPACE, StoragePolicy >::size().
|
inline |
Set the number control points.
| [in] | npts | The target number of control points |
References axom::primal::KnotVector< T >::getDegree(), axom::primal::NURBSCurve< T, NDIMS >::isRational(), axom::primal::KnotVector< T >::makeUniform(), axom::Array< T, DIM, SPACE, StoragePolicy >::resize(), and SLIC_ASSERT.
|
inline |
Clears the list of control points, make nonrational.
References axom::Array< T, DIM, SPACE, StoragePolicy >::clear(), axom::primal::KnotVector< T >::clear(), and axom::primal::NURBSCurve< T, NDIMS >::makeNonrational().
|
inline |
Use array size as flag for rationality.
References axom::Array< T, DIM, SPACE, StoragePolicy >::empty().
|
inline |
Make trivially rational. If already rational, do nothing.
References axom::Array< T, DIM, SPACE, StoragePolicy >::fill(), axom::primal::NURBSCurve< T, NDIMS >::isRational(), axom::Array< T, DIM, SPACE, StoragePolicy >::resize(), and axom::Array< T, DIM, SPACE, StoragePolicy >::size().
|
inline |
Make nonrational. If already rational, do nothing.
References axom::Array< T, DIM, SPACE, StoragePolicy >::resize().
|
inline |
Function to check if the NURBS curve is valid.
References axom::primal::KnotVector< T >::getDegree(), axom::primal::KnotVector< T >::getNumKnots(), axom::primal::NURBSCurve< T, NDIMS >::isRational(), axom::primal::KnotVector< T >::isValid(), and axom::Array< T, DIM, SPACE, StoragePolicy >::size().
|
inline |
Retrieve the control point at index idx.
| [in] | idx | The index of the control point |
|
inline |
Retrieve the control point at index idx.
| [in] | idx | The index of the control point |
|
inline |
|
inline |
|
inline |
Returns a reference to the NURBS curve's control points.
|
inline |
Returns a const reference to the NURBS curve's control points.
|
inline |
Get a specific weight.
| [in] | idx | The index of the weight |
References axom::primal::NURBSCurve< T, NDIMS >::isRational(), and SLIC_ASSERT.
|
inline |
Set the weight at a specific index.
| [in] | idx | The index of the weight |
| [in] | weight | The updated value of the weight |
References axom::primal::NURBSCurve< T, NDIMS >::isRational(), and SLIC_ASSERT.
|
inline |
Returns a reference to the NURBS curve's weights.
|
inline |
Returns a const reference to the NURBS curve's weights.
|
inline |
Returns an axis-aligned bounding box containing the NURBS curve.
References axom::Array< T, DIM, SPACE, StoragePolicy >::data(), and axom::Array< T, DIM, SPACE, StoragePolicy >::size().
|
inline |
Returns an oriented bounding box containing the NURBS curve.
References axom::Array< T, DIM, SPACE, StoragePolicy >::data(), and axom::Array< T, DIM, SPACE, StoragePolicy >::size().
|
inline |
Returns the number of knots in the NURBS Curve.
References axom::primal::KnotVector< T >::getNumKnots().
|
inline |
References axom::primal::KnotVector< T >::getNumKnotSpans().
|
inline |
Normalize the knot vector to the span of [0, 1].
References axom::primal::KnotVector< T >::normalize().
|
inline |
Rescale the knot vector to the span of [a, b].
| [in] | a | The lower bound of the new knot vector |
| [in] | b | The upper bound of the new knot vector |
References axom::primal::KnotVector< T >::rescale(), and SLIC_ASSERT.
|
inline |
Get a specific knot value.
| [in] | idx | The index of the knot |
|
inline |
Set the knot value at a specific index.
| [in] | idx | The index of the knot |
| [in] | knot | The updated value of the knot |
|
inline |
Set the knot vector by an axom::Array.
| [in] | knots | The new knot vector |
|
inline |
Set the knot vector by a KnotVector object.
| [in] | knotVector | The new knot vector |
|
inline |
Return a reference to the knot vector.
|
inline |
Return a const reference to the knot vector.
|
inline |
Get minimum knot value.
References axom::primal::KnotVector< T >::getMinKnot().
|
inline |
Get maximum knot value.
References axom::primal::KnotVector< T >::getMaxKnot().
|
inline |
Reverses the order of the NURBS curve's control points and weights.
References axom::primal::NURBSCurve< T, NDIMS >::getNumControlPoints(), axom::primal::NURBSCurve< T, NDIMS >::isRational(), axom::primal::KnotVector< T >::reverse(), and axom::utilities::swap().
|
inline |
Insert a knot with given multiplicity.
| [in] | t | The parameter value of the knot to insert |
| [in] | target_multiplicity | The multiplicity of the knot to insert |
Algorithm A5.1 on p. 151 of "The NURBS Book"
References axom::utilities::clampVal(), axom::primal::KnotVector< T >::findSpan(), axom::primal::KnotVector< T >::getDegree(), axom::primal::NURBSCurve< T, NDIMS >::getMaxKnot(), axom::primal::NURBSCurve< T, NDIMS >::getMinKnot(), axom::primal::NURBSCurve< T, NDIMS >::getNumControlPoints(), axom::primal::KnotVector< T >::insertKnotBySpan(), axom::primal::NURBSCurve< T, NDIMS >::isRational(), axom::primal::KnotVector< T >::isValidParameter(), axom::utilities::min(), axom::Array< T, DIM, SPACE, StoragePolicy >::size(), and SLIC_ASSERT.
|
inline |
Evaluate a NURBS Curve at a particular parameter value t.
| [in] | t | The parameter value at which to evaluate |
Adapted from Algorithm A4.1 on page 124 of "The NURBS Book"
References axom::primal::KnotVector< T >::calculateBasisFunctionsBySpan(), axom::utilities::clampVal(), axom::primal::KnotVector< T >::findSpan(), axom::primal::KnotVector< T >::getDegree(), axom::primal::NURBSCurve< T, NDIMS >::getMaxKnot(), axom::primal::NURBSCurve< T, NDIMS >::getMinKnot(), axom::primal::NURBSCurve< T, NDIMS >::isRational(), axom::primal::KnotVector< T >::isValidParameter(), and SLIC_ASSERT.
|
inline |
Evaluate the first derivative of NURBS Curve at parameter t.
| [in] | t | The parameter value at which to evaluate |
References axom::primal::NURBSCurve< T, NDIMS >::evaluateDerivatives().
|
inline |
Evaluate the second derivative of NURBS Curve at parameter t.
| [in] | t | The parameter value at which to evaluate |
References axom::primal::NURBSCurve< T, NDIMS >::evaluateDerivatives().
|
inline |
Evaluate the curve and the first derivative at parameter t.
| [in] | t | The parameter value at which to evaluate |
| [out] | eval | The point on the curve at t |
| [out] | Dt | The first derivative of the curve at t |
References axom::primal::NURBSCurve< T, NDIMS >::evaluateDerivatives().
|
inline |
Evaluate the curve and the first two derivatives at parameter t.
| [in] | t | The parameter value at which to evaluate |
| [out] | eval | The point on the curve at t |
| [out] | Dt | The first derivative of the curve at t |
| [out] | DtDt | The second derivative of the curve at t |
References axom::primal::NURBSCurve< T, NDIMS >::evaluateDerivatives().
|
inline |
Evaluate the curve and the first d derivatives at parameter t.
| [in] | t | The parameter value at which to evaluate |
| [in] | d | The number of derivatives to evaluate |
| [out] | eval | The point on the curve at t |
| [out] | ders | An array of the first d derivatives at t |
Implementation adapted from Algorithm A3.2 on p. 93 of "The NURBS Book". Rational derivatives from Algorithm A4.2 on p. 127 of "The NURBS Book".
References axom::utilities::binomialCoefficient(), axom::utilities::clampVal(), axom::primal::KnotVector< T >::derivativeBasisFunctionsBySpan(), axom::primal::KnotVector< T >::findSpan(), axom::primal::KnotVector< T >::getDegree(), axom::primal::NURBSCurve< T, NDIMS >::getMaxKnot(), axom::primal::NURBSCurve< T, NDIMS >::getMinKnot(), axom::primal::NURBSCurve< T, NDIMS >::isRational(), axom::primal::KnotVector< T >::isValidParameter(), axom::utilities::min(), axom::Array< T, DIM, SPACE, StoragePolicy >::resize(), and SLIC_ASSERT.
|
inline |
Splits a NURBS curve into two curves at a given parameter value.
| [in] | t | parameter value at which to evaluate |
| [out] | n1 | First output NURBS curve |
| [out] | n2 | Second output NURBS curve |
| [in] | normalizeParameters | Whether to normalize the output curves |
If t is at the knot u_0 or u_max, will return the original curve and a degenerate curve with the first or last control point
References axom::primal::NURBSCurve< T, NDIMS >::getDegree(), axom::primal::NURBSCurve< T, NDIMS >::getKnots(), axom::primal::NURBSCurve< T, NDIMS >::getMaxKnot(), axom::primal::NURBSCurve< T, NDIMS >::getMinKnot(), axom::primal::NURBSCurve< T, NDIMS >::getNumKnots(), axom::primal::NURBSCurve< T, NDIMS >::insertKnot(), axom::primal::NURBSCurve< T, NDIMS >::isRational(), axom::primal::KnotVector< T >::isValidInteriorParameter(), axom::primal::NURBSCurve< T, NDIMS >::normalize(), axom::primal::NURBSCurve< T, NDIMS >::NURBSCurve(), axom::Array< T, DIM, SPACE, StoragePolicy >::resize(), axom::Array< T, DIM, SPACE, StoragePolicy >::size(), SLIC_ASSERT, and axom::primal::KnotVector< T >::splitBySpan().
|
inline |
Splits a NURBS curve into two curves at the middle parameter value.
| [out] | n1 | First output NURBS curve |
| [out] | n2 | Second output NURBS curve |
| [in] | normalizeParameters | Whether to normalize the output curves |
References axom::primal::NURBSCurve< T, NDIMS >::getMaxKnot(), axom::primal::NURBSCurve< T, NDIMS >::getMinKnot(), and axom::primal::NURBSCurve< T, NDIMS >::split().
|
inline |
Splits a NURBS curve (at each internal knot) into several Bezier curves.
If the curve is of degree 0, will return a set of disconnected, order 0 Bezier curves
Adapted from Algorithm A5.6 on p. 173 of "The NURBS Book"
References axom::primal::NURBSCurve< T, NDIMS >::getDegree(), axom::primal::NURBSCurve< T, NDIMS >::getNumControlPoints(), axom::primal::KnotVector< T >::getNumKnotSpans(), axom::primal::NURBSCurve< T, NDIMS >::getWeight(), and axom::primal::NURBSCurve< T, NDIMS >::isRational().
|
inline |
Simple formatted print of a NURBS Curve instance.
| os | The output stream to write to |
References axom::primal::KnotVector< T >::getDegree(), axom::primal::NURBSCurve< T, NDIMS >::getNumControlPoints(), axom::primal::KnotVector< T >::getNumKnots(), and axom::primal::NURBSCurve< T, NDIMS >::isRational().
|
friend |
Equality operator for NURBS Curves.
| [in] | lhs | The left-hand side NURBS curve |
| [in] | rhs | The right-hand side NURBS curve |
|
friend |
Inequality operator for NURBS Curves.
| [in] | lhs | The left-hand side NURBS curve |
| [in] | rhs | The right-hand side NURBS curve |