Skip to content

Commit a27d5fd

Browse files
committed
fix: don't break if mesh is invalid as refine mesh will fix this
1 parent 7463cc7 commit a27d5fd

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

src/clip.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ void refine_mesh(TriangleMesh &mesh, bool split_long_edges, bool verbose,
129129
// ------------------------------------------------------------------
130130
// 2. Abort when self‑intersections remain
131131
// ------------------------------------------------------------------
132-
std::vector<std::pair<face_descriptor, face_descriptor>> overlaps;
133-
PMP::self_intersections(mesh, std::back_inserter(overlaps));
134-
if (!overlaps.empty()) {
135-
if (verbose)
136-
std::cout << " --> " << overlaps.size()
137-
<< " self‑intersections – remesh skipped\n";
138-
return;
139-
}
132+
// std::vector<std::pair<face_descriptor, face_descriptor>> overlaps;
133+
// PMP::self_intersections(mesh, std::back_inserter(overlaps));
134+
// if (!overlaps.empty()) {
135+
// if (verbose)
136+
// std::cout << " --> " << overlaps.size()
137+
// << " self‑intersections – remesh skipped\n";
138+
// return;
139+
// }
140140

141141
// ------------------------------------------------------------------
142142
// 3. “Tiny patch” bailout: only split long edges
@@ -313,7 +313,6 @@ NumpyMesh clip_plane(NumpyMesh tm, NumpyPlane clipper,
313313
}
314314
refine_mesh(_tm, true, verbose, target_edge_length, number_of_iterations,
315315
protect_constraints, relax_constraints);
316-
// refine_mesh(_clipper, true, verbose, target_edge_length,
317316
// number_of_iterations);
318317

319318
if (verbose) {
@@ -440,8 +439,8 @@ NumpyMesh clip_surface(NumpyMesh tm, NumpyMesh clipper,
440439
}
441440
refine_mesh(_tm, true, verbose, target_edge_length, number_of_iterations,
442441
protect_constraints, relax_constraints);
443-
refine_mesh(_clipper, true, verbose, target_edge_length,
444-
number_of_iterations, protect_constraints, relax_constraints);
442+
// refine_mesh(_clipper, true, verbose, target_edge_length,
443+
// number_of_iterations, protect_constraints, relax_constraints);
445444

446445
if (verbose) {
447446
std::cout << "Remeshing before clipping done." << std::endl;

0 commit comments

Comments
 (0)