manifold
manifold copied to clipboard
Improved smoothing
My halfedge tangent smoothing technique is great for triangles, but does a poor job on quads as quads have to be split into two triangles in one of two ways, and there is no way to pick halfedge tangents that will give a consistent surface between those two triangulations.
I propose solving this by allowing halfedge tangents to take a value of (NaN, NaN, NaN)
. This will mean the tangent does not exist (distinct from (0, 0, 0)
which causes the edge to be faceted). Paired halfedge tangents must both be NaN
if either is. At most one of the three halfedge tangents in a triangle can be NaN
. Any two triangles that share a pair of NaN
tangents are considered a quad (they do not need to be coplanar). The smoothing algorithm will work similarly to the triangular version, but using the mean of two internal Bezier curves rather than three. This will allow exact representation of cylinders and cones, as well as pleasingly symmetric curves for more complex shapes.
Further, the automatic tangent generation in Smooth
can be updated to automatically create quads out of any faces that contain exactly two triangles. Likewise, any faces with more than two triangles will be left flat, by setting their internal tangents to zero length. These faces will also not affect the psuedonormal calculation of their verts, allowing the remaining tangents to match the curved surface instead. This should allow e.g. a cylinder to be automatically refined perfectly.