Skip to content

Commit

Permalink
Snap coordinates to floating points before tetrahedralizing if
Browse files Browse the repository at this point in the history
pre-processing and non-zero tolerance are set.
  • Loading branch information
BrunoLevy committed Sep 23, 2024
1 parent 32418e8 commit f97de58
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib/geogram/mesh/mesh_tetrahedralize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ namespace GEO {
}

if(preprocess) {

// Snap to floating-point coords
if(epsilon > 0) {
index_t N = M.vertices.nb() * M.vertices.dimension();
double* coords = M.vertices.point_ptr(0);
for(index_t i=0; i<N; ++i) {
coords[i] = double(float(coords[i]));
}
}

mesh_repair(M, MESH_REPAIR_DEFAULT, epsilon);
fill_holes(M, max_hole_area);
MeshSurfaceIntersection intersection(M);
Expand Down

0 comments on commit f97de58

Please sign in to comment.