Created by: portnov
Addressed problem description
Given a Surface object, it is easy to convert it to mesh by evaluating it on a cartesian grid, by use of "Evaluate Surface" node. However, in some cases a cartesian grid is not suitable. When the surface has some "almost flat" places and others, that are much more "bent" or even "sharp", a naive cartesian grid approach:
- generates too many points on flat areas
- and generates too few points in the curvy areas.
Solution description
- Start with a cartesian grid.
- Then add more points into "most interesting" grid cells. "Interesting" cells may be defined as:
- Having larger area (more precisely, area stretching factor)
- Having bigger curvature value. Curvature may be defined as Gaussian curvature, mean curvature or as bigger one of the principal curvatures.
- Make a Delaunay triangulation of all these points
- And then map this triangluated thing onto the surface.
This approach can not automatically handle cases where the surface should have sharp edges. However, if we just happen to know where these sharp edges are, we can manually add points on these edges before building a Delaunay triangluation.
On the left: a surface evaluated with cartesian grid; on the right: the same surface with adaptive tessellation. Each of these meshes has (nearly) the same count of triangles - 41K.
The same with wireframe enabled.
Preflight checklist
Put an x letter in each brackets when you're done this item:
-
Code changes complete. -
Code documentation complete. -
Documentation for users complete (or not required, if user never sees these changes). -
Manual testing done. -
Unit-tests implemented. -
Ready for merge.