OpenGLContext.scenegraph.polygontessellator

Class for tessellating polygons using GLU

Classes

Simplified polygon tessellation for IndexedFaceSets & Fonts
OpenGLContext 2.0.0b1 has substantially improved this class, allowing for multiple-contour tessellation, as well as providing mechanisms for returning results other than triangle-sets.
XXX Should have threading lock around tessContours, as any single tessellator is non-thread-safe. XXX Should be doing a GLU version check for this entire module, and degrading to earlier API version if necessary.
controller
tessContours( self , contours , forceTriangles = 1 , normal = None )
Tessellate polygon defined by (multiple) contours
Occasionally will create new vertices as a blending of the given vertex objects.
contours
list of list of vertices, with each set defining a closed contour within the polygon.
forceTriangles
if true (default), returns a set of GL_TRIANGLES-compatible vertex specifications as a list-of-vertex-objects [ Vertex(), Vertex(), ...]
if false, returns vertices), ... where type is the type to be specified for glBegin, and vertices are a list-of-vertex-objects, with the types being any of GL_TRIANGLES, GL_TRIANGLE_STRIP, or GL_TRIANGLE_FAN and the vertices being compatible with the given type.
normal
if specified, calls gluTessNormal with the value, restores to default after the tessellation is complete
return value -- see note on forceTriangles