When manipulating polyhedra it is often necessary to partition their faces into triangles. The obvious method of doing this is to use fan triangulation. For polygons with more than five sides this results in an excessive number of triangles sharing the same vertex. There seems to be a dearth of information on the net for alternative algoritms.
A little reflection on the problem suggests perhaps using a Z pattern instead of a fan. Below I present pseudo code for first the standard fan routine, and then for the zorro routine. They both use the conventional numbering of vertices from 0 to n-1 counter-clockwise.
Fan Algorithm:
for ( v = 1 .. n-2 ) {
emit [ 0, v, v+1 ]
}
Zorro Algorithm:
l = n-1
r = 1
while ( l > r ) {
emit [ l, r-1, r ]
l = l-1
if ( l > r ) {
emit [ l, l+1, r ]
r = r+1
}
}
(The above is most probably just a reinvention.)
Last modified: January 29, 2026