EggNurbsSurface

from panda3d.egg import EggNurbsSurface
class EggNurbsSurface

Bases:

Bases: EggSurface

A parametric NURBS surface.

Inheritance diagram

Inheritance diagram of EggNurbsSurface

class Curves

Bases:

alias of list_PointerTo_EggNurbsCurve

class Loop

Bases:

alias of Curves

class Loops

Bases:

alias of list_Loop

class Trim

Bases:

alias of Loops

class Trims

Bases:

alias of list_Trim

__init__(copy: EggNurbsSurface)
__init__(name: str)
assign(copy: EggNurbsSurface) EggNurbsSurface
static get_class_type() panda3d.core.TypeHandle
get_cv(ui: int, vi: int) EggVertex

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

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

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

get_num_u_knots() int

Returns the number of knots in the U direction.

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

get_num_v_knots() int

Returns the number of knots in the V direction.

get_u_degree() int

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

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

get_u_knot(k: int) float

Returns the nth knot value defined in the U direction.

get_u_knots() list
get_u_order() 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].

get_v_degree() int

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

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

get_v_knot(k: int) float

Returns the nth knot value defined in the V direction.

get_v_knots() list
get_v_order() 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].

get_vertex_index(ui: int, vi: int) int

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

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

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

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.

set_cv(ui: int, vi: int, vertex: EggVertex)

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.

set_num_u_knots(num: int)

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.

set_num_v_knots(num: int)

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.

set_u_knot(k: int, value: float)

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

set_u_order(u_order: int)

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.

set_v_knot(k: int, value: float)

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

set_v_order(v_order: int)

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.

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

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