# panda3d.egg.EggNurbsSurface¶

class EggNurbsSurface

Bases: EggSurface

A parametric NURBS surface.

Inheritance diagram

__init__(copy: EggNurbsSurface) → None
__init__(name: str) → None
assign(copy: EggNurbsSurface) → EggNurbsSurface
Return type

EggNurbsSurface

setup(u_order: int, v_order: int, num_u_knots: int, num_v_knots: int) → None

Prepares a new surface definition with the indicated order and number of knots in each dimension. This also implies a particular number of vertices in each dimension 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 surface by repeatedly calling push_back().

setUOrder(u_order: int) → None

Directly changes the order in the U direction to the indicated value (which must be an integer in the range 1 <= u_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 surface.

setVOrder(v_order: int) → None

Directly changes the order in the V direction to the indicated value (which must be an integer in the range 1 <= v_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 surface.

setNumUKnots(num: int) → None

Directly changes the number of knots in the U direction. 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 surface.

setNumVKnots(num: int) → None

Directly changes the number of knots in the V direction. 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 surface.

setUKnot(k: int, value: float) → None

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

setVKnot(k: int, value: float) → None

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

setCv(ui: int, vi: int, vertex: EggVertex) → None

Redefines the control vertex associated with a particular u, v coordinate pair. This is just a shorthand to access the EggPrimitive’s normal vertex assignment for a 2-d control vertex.

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.

getUOrder() → int

Returns the order of the surface in the U direction. 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].

getVOrder() → int

Returns the order of the surface in the V direction. 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].

getUDegree() → int

Returns the degree of the surface in the U direction. For a typical NURBS, the degree is 3.

getVDegree() → int

Returns the degree of the surface in the V direction. for a typical NURBS, the degree is 3.

getNumUKnots() → int

Returns the number of knots in the U direction.

getNumVKnots() → int

Returns the number of knots in the V direction.

getNumUCvs() → int

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

getNumVCvs() → int

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

getNumCvs() → int

Returns the total number of control vertices that should be defined for the surface. 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 surface. (However, if the number of vertices in the surface are wrong, the surface is invalid.)

getUIndex(vertex_index: int) → int

Returns the U index number of the given vertex within the EggPrimitive’s linear list of vertices. An EggNurbsSurface maps a linear list of vertices to its 2-d mesh; this returns the U index number that corresponds to the nth vertex in the list.

getVIndex(vertex_index: int) → int

Returns the V index number of the given vertex within the EggPrimitive’s linear list of vertices. An EggNurbsSurface maps a linear list of vertices to its 2-d mesh; this returns the V index number that corresponds to the nth vertex in the list.

getVertexIndex(ui: int, vi: int) → int

Returns the index number within the EggPrimitive’s list of the control vertex at position ui, vi.

isClosedU() → bool

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

isClosedV() → bool

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

getUKnot(k: int) → float

Returns the nth knot value defined in the U direction.

getVKnot(k: int) → float

Returns the nth knot value defined in the V direction.

getCv(ui: int, vi: int) → EggVertex

Returns the control vertex at the indicate U, V position.

Return type

EggVertex

static getClassType() → TypeHandle
Return type

TypeHandle

getUKnots() → list
getVKnots() → list
Curves

alias of list_PointerTo_EggNurbsCurve

Loop

alias of list_PointerTo_EggNurbsCurve

Loops

alias of list_Loop

Trim

alias of list_Loop

Trims

alias of list_Trim