Subdivision classes

Overview

These classes provide a framework in which it is possible to perform Catmull-Clark subdivision on polygon meshes. There are two main classes:

Mesh

The Mesh constructor consumes an input mesh, which is specified by two parameters: It converts this representation into an internal structure representing adjacency information. This internal structure consists of Faces, Vertices, and Stencils. A Face knows it's neighboring faces and the Vertices making up it's corners. This web of adjacency information remains unchanged by subdivision, as it represents the adjacency at the coarsest level only.

A Face also contains a set of Stencils, which represent subdivided face information. Stencils are, conceptually, square arrays of points (represented by the Point3 utility class). GetStencil which will retrieve the nth stencil. The level 0 stencil contains the coarse-level information. Other stencils are populated by calling a subdivision routine. The subdivision routine uses the stencil at the next coarser level to construct the new level. The stencil at level n contains a (2^n+1) by (2^n+1) array of points. Accessor operations at the Stencil level allow access to points neighoring any point in the Stencil, including those that may be on another face. This Face/Stencil/Vertex structure thus allows the conversion of topological location on the mesh into actual, 3-dimensional location.

VRMLDivide

The VMRLDivide constructor takes an SoIndexedFaceSet node, and a field representing the coordIndex field of the SoIndexedFaceSet. If the VRML API had been clever enough to make coordIndex an exposedField, this extra parameter would not have been necessary. The constructor ferrets through these elements looking for the necessary inputs to the Mesh constructor and creates an internal mesh. The VRMLDivide class also exposes the Mesh's subdivision methods, and a method to convert a subdivided mesh at a given level into VRML text.

author