NURBS (nonuniform rational basis splines) are a generalized form of B-Splines. They allow for modeling many curves, including projected forms. DXF splines, for example, are based on NURBS. This class provides functions and methods to work with NURBS.
More...
|
| | Nurbs () |
| | Default constructor for the Nurbs class.
|
| |
| | Nurbs (uint32 degree, const Vertex3 *controlpoints, size_t controlCount, const double *knots, size_t knotCount, const double *weights, size_t weightCount) |
| | Constructor for the Nurbs class.
|
| |
| | ~Nurbs () override |
| | Destructor.
|
| |
| Vertex3 | point (double t) |
| | Returns a point on the curve at a given parameter value.
|
| |
| double | start () const |
| | This method returns the smallest value of t.
|
| |
| double | end () const |
| | This method returns the maximum value of t.
|
| |
| size_t | startIndex () const |
| | The start index for calculating min t.
|
| |
| size_t | endIndex () const |
| | The start index for calculating max t.
|
| |
| size_t | controlPointCount () const |
| | Returns the number of control points.
|
| |
| size_t | knotCount () const |
| | Returns the knot count.
|
| |
| double | knot (size_t index) const |
| | returns a knot
|
| |
| bool | isClamped () const |
| | Returns true, if the NURBS is clamped.
|
| |
| bool | isClosed () const |
| | Returns true, if NURBS is closed.
|
| |
| uint32 | degree () const |
| | Returns the degree.
|
| |
| jm::Vertex3 | controlPoint (size_t index) const |
| |
| double | weight (size_t index) const |
| |
| double | N (size_t i, uint32 k, double t) |
| | This method returns the value of N_i,k(t).
|
| |
| double | R (size_t i, uint32 k, double t) |
| | This method returns the weight of the control points R_i,k(t).
|
| |
| | Object () noexcept |
| | Constructor.
|
| |
| virtual | ~Object () noexcept |
| | Destructor.
|
| |
| void | release () noexcept |
| | Decreases the reference counter and releases the object immediately when the reference counter becomes 0.
|
| |
| Object * | retain () noexcept |
| | Increases the reference counter of this object by 1.
|
| |
| Object * | autorelease () noexcept |
| | Same function as release(), but releases the object with a delay if the reference counter is 0. AutoreleasePool::drain() must be called in the to release the object.
|
| |
| int32 | referenceCount () const noexcept |
| | Returns the value of the reference counter.
|
| |
| virtual bool | equals (const Object *other) const |
| | Comparison of objects.
|
| |
| virtual String | displayName () const |
| | Returns the display name of the object intended to present to a user.
|
| |
| virtual void | printDiffInfo (DiffOperation operation, Object *other) const |
| | Output method for outputting the diff results for the diff algorithm.
|
| |
| void | setHighBit (bool status) noexcept |
| |
| bool | highBit () const noexcept |
| |
NURBS (nonuniform rational basis splines) are a generalized form of B-Splines. They allow for modeling many curves, including projected forms. DXF splines, for example, are based on NURBS. This class provides functions and methods to work with NURBS.
Advantages of NURBS (http://www-lehre.inf.uos.de/~cg/2006/PDF/kap-07.pdf):
- NURBS are a generalization of B-Splines. When hi = 1 for all i, the NURBS curve reduces to the corresponding B-Spline curve.
- NURBS are invariant under perspective projection. This means that not all curve points need to be projected, only the control points need to be projected and then connected to form a curve.
- NURBS are capable of describing circles (unlike non-rational B-Splines).
◆ Nurbs() [1/2]
Default constructor for the Nurbs class.
◆ Nurbs() [2/2]
| jm::Nurbs::Nurbs |
( |
uint32 |
degree, |
|
|
const Vertex3 * |
controlpoints, |
|
|
size_t |
controlCount, |
|
|
const double * |
knots, |
|
|
size_t |
knotCount, |
|
|
const double * |
weights, |
|
|
size_t |
weightCount |
|
) |
| |
Constructor for the Nurbs class.
- Parameters
-
| degree | The degree of the polynomial. |
| controlpoints | An array of control points. |
| controlCount | The length of the controlpoints array. |
| knots | An array of knots. |
| knotCount | The length of the knots array. |
| weights | An array of weights. |
| weightCount | The length of the weights array. |
◆ ~Nurbs()
◆ controlPoint()
| jm::Vertex3 jm::Nurbs::controlPoint |
( |
size_t |
index | ) |
const |
◆ controlPointCount()
| size_t jm::Nurbs::controlPointCount |
( |
| ) |
const |
Returns the number of control points.
◆ degree()
| uint32 jm::Nurbs::degree |
( |
| ) |
const |
◆ end()
| double jm::Nurbs::end |
( |
| ) |
const |
This method returns the maximum value of t.
◆ endIndex()
| size_t jm::Nurbs::endIndex |
( |
| ) |
const |
The start index for calculating max t.
◆ isClamped()
| bool jm::Nurbs::isClamped |
( |
| ) |
const |
Returns true, if the NURBS is clamped.
◆ isClosed()
| bool jm::Nurbs::isClosed |
( |
| ) |
const |
Returns true, if NURBS is closed.
◆ knot()
| double jm::Nurbs::knot |
( |
size_t |
index | ) |
const |
◆ knotCount()
| size_t jm::Nurbs::knotCount |
( |
| ) |
const |
◆ N()
| double jm::Nurbs::N |
( |
size_t |
i, |
|
|
uint32 |
k, |
|
|
double |
t |
|
) |
| |
This method returns the value of N_i,k(t).
- Parameters
-
| i | The index of the control point. |
| k | The degree of the polynomial for which N is returned. (Not necessarily the degree of the NURBS) |
| t | The parameter value along the curve. |
- Returns
- The value of N_i,k(t) at the given parameter value.
◆ point()
| Vertex3 jm::Nurbs::point |
( |
double |
t | ) |
|
Returns a point on the curve at a given parameter value.
- Parameters
-
| t | The parameter value on the curve. Should be in the range [0, t_max]. |
- Returns
- The point on the curve at the given parameter value.
◆ R()
| double jm::Nurbs::R |
( |
size_t |
i, |
|
|
uint32 |
k, |
|
|
double |
t |
|
) |
| |
This method returns the weight of the control points R_i,k(t).
- Parameters
-
| i | The index of the control point. |
| k | The degree of the polynomial for which R is returned. |
| t | The parameter value along the curve. |
- Returns
- The weight of the control point at the given parameter value.
◆ start()
| double jm::Nurbs::start |
( |
| ) |
const |
This method returns the smallest value of t.
◆ startIndex()
| size_t jm::Nurbs::startIndex |
( |
| ) |
const |
The start index for calculating min t.
◆ weight()
| double jm::Nurbs::weight |
( |
size_t |
index | ) |
const |