The goal of this app is to re-mesh an arbitrary input triangle mesh via a method of evolving surfaces with tangential redistribution (area based, angle based...).
Done: generate a distance field field around a mesh using the Fast Sweeping Method. The initial condition for the FSM is set by constructing an AABB tree for the mesh triangles (or any mesh features in general), using it for faster lookup during Octree box cell intersection queries. The Octree leaves are then set to the distance to the closest triangle to the cell centroid.
Current WIP:
- Implement volume-based tangential redistribution
2. Using the AABB Tree, construct an Octree with homogeneous disjoint leaf cells which intersect the mesh
3. Construct a grid and set the value of all cells which intersect the mesh to exact distance from cell centroid to the closest triangle and LARGE_VAL
elsewhere:
4. Using the grid from step (3) as an initial condition for the Eikonal equation |grad(d(x))| = 1
find its solution (distance function) using the Fast Sweeping Method:
|MyMethodGrid(x,y,z) - BruteForceGrid(x,y,z)|
Sign is computed by negating the grid field d(x,y,z) and flood filling "unfrozen" voxels to set external sign > 0:
- clearly, if the mesh has holes, the flood fill will set all non-boundary voxels to external
1.2 Evolution in the Normal Direction - Finite Volume Scheme for Laplace-Beltrami Operator and Mean Curvature Flow
X -> evolving surface points, N -> ev. surface normal, Laplace_X -> mesh Laplace-Beltrami operator, d(X) - signed distance function (SDF)
(see ./SurfaceEvolver/EvolutionCore/Parameters.h
)
C1 = 1.0, C2 = rDecay
(exp. decay radius of the initial sphere)C = 1.0, D = 0.0
S0 = 0.05 (initSmoothRate), lambda = 0.1 (smoothDecay)
Smoothing model: Follows the above evolution equation with parameters:
================================
>>> Evolution error log ........
dt = 0.01, Nsteps = 6, Nverts = 42
L2Error = 0.00306691
dt = 0.0025, Nsteps = 24, Nverts = 162
L2Error = 0.000867556, EOC = 1.82176
dt = 0.000625, Nsteps = 96, Nverts = 642
L2Error = 0.000210643, EOC = 2.04216
dt = 0.00015625, Nsteps = 384, Nverts = 2562
L2Error = 5.1363e-05, EOC = 2.036
- octreeResolution =
40^3
, SDF_gridResolution =120 x 106 x 106
- NTimeSteps =
150
, NSmoothingSteps =10
, dt =0.03
- NVerts =
642
- octreeResolution =
40^3
, SDF_gridResolution =120^3
- NTimeSteps =
150
, NSmoothingSteps =10
, dt =0.03
- NVerts =
642
- octreeResolution =
40^3
, SDF_gridResolution =119 x 106 x 106
- NTimeSteps =
150
, NSmoothingSteps =10
, dt =0.03
- NVerts =
642
- octreeResolution =
40^3
, SDF_gridResolution =120 x 119 x 120
- NTimeSteps =
150
, dt =0.03
- NVerts =
2562
- D =
1.0
Graphics annotation: - vectors: vertex normals (black), grad(distance) (red)
- scalars: dot(grad(distance), vNormal)
- D =
0.0
- scalars: dot(-grad(distance), vNormal)
- NVerts =
642
, NSmoothingSteps =10
- octreeResolution =
40^3
, SDF_gridResolution =120 x 115 x 96
- NTimeSteps =
150
, dt =0.03
- NVerts =
2562
- NSmoothSteps =
10