This is a simple modifier that implements vertex collapsing. This modifier is used to simplify geometry by removing vertices and serves as a "delete vertex feature". However since this algorithm works on a winged edge mesh there are some important conditions.
Please right click to download source code for this example.
This modifier is simple to understand. The data interface is quite skeletal and used only to facilitate a scripted create command. There is no specific property sheet for this modifier because the modifier has no additional parameters beyond the parameters from the super-class modifier. The create command is implemented via script in modifier_scripts.ssl
The vertex collapse algorithm performs vertex collapse operations in series because the results of one vertex collapse may affect the results of any subsequent vertex collapses. This is a key concept when writing modifiers: serial operation -vs- rare cases of parallel operation. Each stage of a modifier changes the mesh but you can test if the items in the selection are connected to each other and operate independently on each item on items that are not connected. Specific steps in this algorithm are as follows: