# EggNurbsCurve

```from panda3d.egg import EggNurbsCurve
```
class EggNurbsCurve

Bases:

Bases: `EggCurve`

A parametric NURBS curve.

Inheritance diagram

__init__(copy: EggNurbsCurve)
__init__(name: str)
assign(copy: EggNurbsCurve)
property closed bool

Returns true if the curve appears to be closed. Since the Egg syntax does not provide a means for explicit indication of closure, this has to be guessed at by examining the curve itself.

property degree int

Returns the degree of the curve. For a typical NURBS, the degree is 3.

static getClassType()
getDegree() int

Returns the degree of the curve. For a typical NURBS, the degree is 3.

getKnot(k: int)

Returns the nth knot value defined.

getKnots() list
getNumCvs() int

Returns the total number of control vertices that should be defined for the curve. This is determined by the number of knots and the order, in each direction; it does not necessarily reflect the number of vertices that have actually been added to the curve. (However, if the number of vertices in the curve are wrong, the curve is invalid.)

getNumKnots() int

Returns the number of knots.

getOrder() int

Returns the order of the curve. The order is the degree of the NURBS equation plus 1; for a typical NURBS, the order is 4. With this implementation of NURBS, the order must be in the range [1, 4].

isClosed() bool

Returns true if the curve appears to be closed. Since the Egg syntax does not provide a means for explicit indication of closure, this has to be guessed at by examining the curve itself.

isValid() bool

Returns true if the NURBS parameters are all internally consistent (e.g. it has the right number of vertices to match its number of knots and order in each dimension), or false otherwise.

property knots
Getter

Returns the nth knot value defined.

Setter

Resets the value of the indicated knot as indicated. k must be in the range 0 <= k < `getNumKnots()`, and the value must be in the range get_knot(k - 1) <= value <= get_knot(k + 1).

property order int
Getter

Returns the order of the curve. The order is the degree of the NURBS equation plus 1; for a typical NURBS, the order is 4. With this implementation of NURBS, the order must be in the range [1, 4].

Setter

Directly changes the order to the indicated value (which must be an integer in the range 1 <= order <= 4). If possible, it is preferable to use the `setup()` method instead of this method, since changing the order directly may result in an invalid curve.

setKnot(k: int, value: float)

Resets the value of the indicated knot as indicated. k must be in the range 0 <= k < `getNumKnots()`, and the value must be in the range get_knot(k - 1) <= value <= get_knot(k + 1).

setNumKnots(num: int)

Directly changes the number of knots. This will either add zero-valued knots onto the end, or truncate knot values from the end, depending on whether the list is being increased or decreased. If possible, it is preferable to use the `setup()` method instead of directly setting the number of knots, as this may result in an invalid curve.

setOrder(order: int)

Directly changes the order to the indicated value (which must be an integer in the range 1 <= order <= 4). If possible, it is preferable to use the `setup()` method instead of this method, since changing the order directly may result in an invalid curve.

setup(order: int, num_knots: int)

Prepares a new curve definition with the indicated order and number of knots. This also implies a particular number of vertices as well (the number of knots minus the order), but it is up to the user to add the correct number of vertices to the curve by repeatedly calling push_back().