OpenGLContext.scenegraph.polygon
Holder for metadata regarding a polygon
Functions
Classes
class DegeneratePolygon(
object
):
Class encapsulated a degenerate triangle definition
At the moment this is not a particularly useful class,
eventually it might be used for interactive debugging
of the geometry (for instance highlighting the degenerate
polygons with indexed line sets).
Note: an index of -1 indicates a likely tesselation-
generated vertex.
Holder for metadata regarding a particular polygon
Often during certain operations (such as tessellation)
is useful to have an object for representing a polygon
which binds together all the metadata regarding that
polygon.
The Polygon class is modeled as a simple list-of-vertices
with a convenience method normalise to make the class
easier to use when dealing with triangle-only systems
such as the array geometry classes.
__init__(
self
,
polyIndex
= -1
,
node
= None
,
points
= None
,
ccw
= True
)
Initialize the polygon
- polyIndex
- more accurately "polygon ID", an opaque value used to identify the polygon.
- node
- optional reference to the scenegraph node from which we are derived, used primarily during error reporting to give feedback regarding which node has encountered the error.
- points
- list of vertices which make up the definition of the polygon.
checkVertices(
self
)
Check set of triangle vertices for possible degeneracy
At the moment this checks for condition:
- vertices are collinear
Returns only the well formed triangles from the input
triangle vertex set. (Note that this is called by normalise,
which explains the rather strange input and output).