panda3d.egg.EggCompositePrimitive

from panda3d.egg import EggCompositePrimitive
class EggCompositePrimitive

Bases: EggPrimitive

The base class for primitives such as triangle strips and triangle fans, which include several component triangles, each of which might have its own color and/or normal.

Inheritance diagram

Inheritance diagram of EggCompositePrimitive

assign(copy: EggCompositePrimitive) → EggCompositePrimitive
Return type

EggCompositePrimitive

property components
Getter

Returns the attributes for the nth component triangle.

Returns the attributes for the nth component triangle.

Setter

Changes the attributes for the nth component triangle.

Return type

Sequence[EggAttributes]

static getClassType() → TypeHandle
Return type

TypeHandle

getComponent(i: size_t) → EggAttributes

Returns the attributes for the nth component triangle.

Return type

EggAttributes

getComponent(i: size_t) → EggAttributes

Returns the attributes for the nth component triangle.

Return type

EggAttributes

getComponents() → list
getNumComponents() → size_t

Returns the number of individual component triangles within the composite. Each one of these might have a different set of attributes.

Return type

size_t

setComponent(i: size_t, attrib: EggAttributes) → None

Changes the attributes for the nth component triangle.

triangulateInPlace() → EggCompositePrimitive

Subdivides the composite primitive into triangles and adds those triangles to the parent group node in place of the original primitive. Returns a pointer to the original primitive, which is likely about to be destructed.

If convex_also is true, both concave and convex polygons will be subdivided into triangles; otherwise, only concave polygons will be subdivided, and convex polygons will be copied unchanged into the container.

Return type

EggCompositePrimitive

triangulateInto(container: EggGroupNode) → bool

Subdivides the composite primitive into triangles and adds those triangles to the indicated container. Does not remove the primitive from its existing parent or modify it in any way.

Returns true if the triangulation is successful, or false if there was some error (in which case the container may contain some partial triangulation).