Fix outline bound check for full outlines

This commit is contained in:
tamasmeszaros 2023-08-18 16:49:50 +02:00
parent 44d91ec353
commit 01d5f04295

View File

@ -99,14 +99,11 @@ bool check_coord_bounds(const BoundingBoxf &bb)
ExPolygons extract_full_outline(const ModelInstance &inst, const Transform3d &tr) ExPolygons extract_full_outline(const ModelInstance &inst, const Transform3d &tr)
{ {
ExPolygons outline; ExPolygons outline;
if (check_coord_bounds(to_2d(instance_bounding_box(inst, tr)))) {
for (const ModelVolume *v : inst.get_object()->volumes) { for (const ModelVolume *v : inst.get_object()->volumes) {
Polygons vol_outline; Polygons vol_outline;
if (!check_coord_bounds(to_2d(v->mesh().transformed_bounding_box(tr)))) {
outline.clear();
break;
}
vol_outline = project_mesh(v->mesh().its, vol_outline = project_mesh(v->mesh().its,
tr * inst.get_matrix() * v->get_matrix(), tr * inst.get_matrix() * v->get_matrix(),
[] {}); [] {});
@ -120,6 +117,7 @@ ExPolygons extract_full_outline(const ModelInstance &inst, const Transform3d &tr
default:; default:;
} }
} }
}
return outline; return outline;
} }