Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

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 for details on creating tessellator objects.

Using Tessellator Objects

The procedure file obj_tess.pro, located in the examples/visual subdirectory of the IDL distribution, provides an example of the use of the IDLgrTessellator object. To run the example, enter OBJ_TESS at the IDL prompt. The 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.


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]