EggNurbsCurve

from panda3d.egg import EggNurbsCurve
class EggNurbsCurve

Bases:

Bases: EggCurve

A parametric NURBS curve.

Inheritance diagram

Inheritance diagram of EggNurbsCurve

__init__(copy: EggNurbsCurve)
__init__(name: str)
assign(copy: EggNurbsCurve) 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 get_class_type() panda3d.core.TypeHandle
get_degree() int

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

get_knot(k: int) float

Returns the nth knot value defined.

get_knots() list
get_num_cvs() 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.)

get_num_knots() int

Returns the number of knots.

get_order() 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].

is_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.

is_valid() 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 Sequence[float]
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 < get_num_knots(), 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.

set_knot(k: int, value: float)

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

set_num_knots(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.

set_order(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().