Tri To Quad SOP

Overview

This sop attempts to clean up triangulated meshes and turn them into quad meshes.  It works very simply by comparing triangles that share an edge and testing if removing it will result in a quad within the parameters specified. This is by no means a perfect solution, however it does work reasonably well on geometry that started life as quads and then became triangulated perhaps as a result of being saved in a format that doesn't support quads, like dxf.

Usage

Wire a triangulated model into this sop then adjust the tolerence and coplanar parameters to get the best quad mesh result.
With a group supplied only those polygons in the group will be concidered for quading.
To make this sops group selectable in the viewport add the following line to your 456.cmd

omsbind -t sop tri2quad:group prims "First input" "Select the tris to make quads" 0 1 poly 0 "" 0

Parameters

Group The group of polygons to test.
Tolerence A measure of how close to square the resulting quads will be.  Higher values mean greater tolerence for non square quads as a result of removing edges.
Coplanar How coplanar are the resulting quads. Lower values mean the result must be a better flatter quad. A value of 0 means the resulting quad must be totally planar.
Proper pair A proper pair of triangles is one where both share the same long edge.  With this off then the long edge need only exist in one of the pair of triangles.
Zap unempty tris This is an additional test that removes triangles composed of 3 smaller triangles. These often appear in meshes made using marching cubes algorithms.
Zap 4-tri quads This is an additional test that removes quads composed of 4 smaller triangles. These often appear in meshes made using marching cubes algorithms.
Remove min length edges too With this option on then after long edge pairs are tested any other remaining pairs of triangles sharing any edge will be tested to see if they fit the tolerence and coplanar tests.