Building Polygons in ICE

 
 
 

You build polygons by specifying how to join vertices by edges. Polygons are described by listing the indices of their vertices in counter-clockwise order when the normal is facing you. The first and last vertices are joined automatically — you cannot specify the same vertex twice for the same polygon. Reversing the order of vertices means that the polygon will be facing the other way, that is, inverted.

Adding Polygons

The Add Polygon node adds a single polygon using an array of pre-existing vertices. To continue the example above, you can add another vertex and polygon. In this case, the new polygon is a triangle that shares an edge with the first polygon.

Creating Topologies

As an alternative to building polygons one at a time with Add Polygon, you can use the Create Topo node to build the entire topology at once. Create Topo takes two arrays: an array of positions for the vertices and an array of integers to describe the polygons. The integers in the polygonal description array refer to the indices of the positions in the first array. Again, the vertices of each polygon are listed in counter-clockwise order when the normal is facing you. You can use any negative number to specify the end of one polygon before beginning the next one.

Make sure that all integers in the polygonal description array are valid vertex indices. You should also make sure to terminate even the last polygon with a negative value. Note that if you get the mesh's PolygonalDescription attribute, -2 is always used to terminate polygons no matter which negative value you used to set it.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License