THIS EXAMPLE DOES NOT IMPLEMENT A MODIFIER; IMPORTANT ITERATION AND TRAVERSAL FUNCTIONALITY IS DISCUSSED. This is a very simple command that handles conversion between face, edge, and vertex selection-sets. This introduces and highlights several key concepts related to working with a winged-edge mesh:
Collectively these concepts form the most basic operations required to implement a modifier and although this code is not a modifier, the concepts are exactly the same.
A discreet set refers to the concept of working with a geometry-set of a single type. Generally speaking you do not work with a face-and-edge set or a vertex-and-edge set; you work with a face-set and derive the vertex-set if necessary or you work with a vertex-set and derive the face-set or edge-set if necessary.
Collectively traversal generally refers to the process of iterating through mesh elements and traversing or deriving as needed. Though this is not the traversal method used by FaceEdgeVertexConvert_Command, an example of traversal is as follows:
Therefore traversal is a bit more inclusive than iteration and can refer to the process of iterating and deriving geometry based on conditions set forth by an algorithm.
Please right click to download source code for this example.
This command is separated into three key sections:
As you examine the code you'll notice several things:
These operations are fundamental to modifier implementation. Validity is very important because modifiers should not create certain types of invalid geometry such as non-connected elements or "fins". Validity testing does not catch all errors.