mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 11:23:42 +00:00
💥Fix crash svg use surface (#13262)
* Fix crash svg use surface * unnecesarry header
This commit is contained in:
@@ -2559,6 +2559,21 @@ void priv::create_face_types(FaceTypeMap &map,
|
|||||||
bool priv::clip_cut(SurfacePatch &cut, CutMesh clipper)
|
bool priv::clip_cut(SurfacePatch &cut, CutMesh clipper)
|
||||||
{
|
{
|
||||||
CutMesh& tm = cut.mesh;
|
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
|
// create backup for case that there is no intersection
|
||||||
CutMesh backup_copy = tm;
|
CutMesh backup_copy = tm;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user