EggPolygon

from panda3d.egg import EggPolygon
class EggPolygon

Bases:

Bases: EggPrimitive

A single polygon.

Inheritance diagram

Inheritance diagram of EggPolygon

__init__(copy: EggPolygon)
__init__(name: str)
assign(copy: EggPolygon) EggPolygon
calculate_normal(result: panda3d.core.LNormald, cs: panda3d.core.CoordinateSystem) bool

Calculates the true polygon normal–the vector pointing out of the front of the polygon–based on the vertices. This does not return or change the polygon’s normal as set via set_normal().

The return value is true if the normal is computed correctly, or false if the polygon is degenerate and does not have at least three noncollinear vertices.

static get_class_type() panda3d.core.TypeHandle
is_planar() bool

Returns true if all of the polygon’s vertices lie within the same plane, false otherwise.

recompute_polygon_normal(cs: panda3d.core.CoordinateSystem) bool

Recalculates the normal according to the order of the vertices, and sets it. Returns true if the normal is computed correctly, or false if the polygon is degenerate and does not have a normal.

triangulate_in_place(convex_also: bool) EggPolygon

Subdivides the polygon into triangles and adds those triangles to the parent group node in place of the original polygon. Returns a pointer to the original polygon, 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.

triangulate_into(container: EggGroupNode, convex_also: bool) bool

Subdivides the polygon into triangles and adds each one to the indicated container. If the polygon is already a triangle, adds an exact copy of the polygon to the container. Does not remove the polygon 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).

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.