mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 00:55:54 +08:00
Fix outline bound check for full outlines
This commit is contained in:
parent
44d91ec353
commit
01d5f04295
@ -99,25 +99,23 @@ 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;
|
||||||
for (const ModelVolume *v : inst.get_object()->volumes) {
|
|
||||||
Polygons vol_outline;
|
|
||||||
|
|
||||||
if (!check_coord_bounds(to_2d(v->mesh().transformed_bounding_box(tr)))) {
|
if (check_coord_bounds(to_2d(instance_bounding_box(inst, tr)))) {
|
||||||
outline.clear();
|
for (const ModelVolume *v : inst.get_object()->volumes) {
|
||||||
break;
|
Polygons vol_outline;
|
||||||
}
|
|
||||||
|
|
||||||
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(),
|
||||||
[] {});
|
[] {});
|
||||||
switch (v->type()) {
|
switch (v->type()) {
|
||||||
case ModelVolumeType::MODEL_PART:
|
case ModelVolumeType::MODEL_PART:
|
||||||
outline = union_ex(outline, vol_outline);
|
outline = union_ex(outline, vol_outline);
|
||||||
break;
|
break;
|
||||||
case ModelVolumeType::NEGATIVE_VOLUME:
|
case ModelVolumeType::NEGATIVE_VOLUME:
|
||||||
outline = diff_ex(outline, vol_outline);
|
outline = diff_ex(outline, vol_outline);
|
||||||
break;
|
break;
|
||||||
default:;
|
default:;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user