💥Fix crash svg use surface (#13262)

* Fix crash svg use surface

* unnecesarry header
This commit is contained in:
Rodrigo Faselli
2026-04-22 13:21:19 -03:00
committed by GitHub
parent 5b05b6104a
commit e99382da68

View File

@@ -2559,6 +2559,21 @@ void priv::create_face_types(FaceTypeMap &map,
bool priv::clip_cut(SurfacePatch &cut, CutMesh clipper)
{
CutMesh& tm = cut.mesh;
auto is_mesh_usable_for_clip = [](const CutMesh &mesh) {
return !mesh.is_empty() &&
mesh.number_of_vertices() >= 3 &&
mesh.number_of_faces() > 0 &&
mesh.is_valid(false);
};
if (!is_mesh_usable_for_clip(tm) || !is_mesh_usable_for_clip(clipper))
return false;
// Hard-stop pathological inputs before entering corefinement internals.
if (CGAL::Polygon_mesh_processing::does_self_intersect(tm) ||
CGAL::Polygon_mesh_processing::does_self_intersect(clipper))
return false;
// create backup for case that there is no intersection
CutMesh backup_copy = tm;