This is a program for generating the topological dual of a polygonal Open Inventor object.
The default operation is to construct the topological dual as follows:
For each topological vertex in the infile.iv, construct a polygon face in the outfile.iv consisting of the midpoints of each face containing the vertex. This is the so-called 'inscribed' dual of the infile.iv.
Examples of the dual of this type are:
But, the algorithm works for any welded, polygon object:
If the -e option is used, the topological dual is constructed as follows:
For each topological edge in the infile.iv, construct a polygon face in the outfile.iv consisting of the the endpoints of the edge, alternated with the midpoints of each face on the edge projected along the face's normal, into the plane perpendicular to the normal vectors to the faces averaged at the edge.
An example of the dual of this type is the Rhombic Tricontahedron generated by an Icosahedron:
The infile.iv is assumed to consist of SoIndexedFaceSet nodes, 'welded' such that the topological edges between adjacent pairs of polygon faces can be procedurally identified.
In order that a polygon mesh can be treated as a topological object, neighboring polygons sharing a common edge must reference the same, single pair of vertices defining that edge.
qweldobj will read a Wavefront '.obj' file, remove the redundant vertices at each common edge and produce welded indexed faces in a Wavefront '.obj' file on output.