Tessellator Objects

The IDLgrTessellator class is a helper class that converts a simple concave polygon (or a simple polygon with holes) into a number of simple convex polygons (general triangles). A polygon is simple if it includes no duplicate vertices, if the edges intersect only at vertices, and exactly two edges meet at any vertex.

Tessellation is useful because the IDLgrPolygon object accepts only convex polygons. Using the IDLgrTessellator object, you can convert a concave polygon into a group of convex polygons.

Creating Tessellator Objects

The IDLgrTessellator::Init method takes no arguments. Use the following statement to create a tessellator object:

myTess = OBJ_NEW('IDLgrTessellator') 

See "IDLgrTessellator" (IDL Reference Guide) for details on creating tessellator objects.

Using Tessellator Objects

The obj_tess.pro procedure creates a concave polygon, attempts to draw it, and then tessellates the polygon and re-draws. Finally, the procedure demonstrates adding a hole to a polygon. (You will be prompted to press Return after each step is displayed.) You can also inspect the source code in the obj_tess.pro file for hints on using the tessellator object.

Example Code
The procedure file obj_tess.pro, located in the examples/doc/objects subdirectory of the IDL distribution, provides an example using the IDLgrTessellator object. Run the example procedure by entering obj_tess at the IDL command prompt or view the file in an IDL Editor window by entering .EDIT obj_tess.pro.