ENH: support exclude objects for klipper printer

Thanks OrcaSlicer.

This is just function for klipper printer.
NEVER used for BBL printer.

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: I910abceb67f4dcb4260f74f5dd1b4fb614812670
This commit is contained in:
salt.wei 2023-06-19 11:07:21 +08:00 committed by Lane.Wei
parent 0daca9d329
commit e567afdcb5
11 changed files with 146 additions and 5 deletions

View file

@ -1384,6 +1384,16 @@ BoundingBoxf3 ModelObject::instance_bounding_box(size_t instance_idx, bool dont_
return bb;
}
BoundingBoxf3 ModelObject::instance_bounding_box(const ModelInstance& instance, bool dont_translate) const {
BoundingBoxf3 bbox;
const auto& inst_mat = instance.get_transformation().get_matrix(dont_translate);
for (auto vol : this->volumes) {
if (vol->is_model_part())
bbox.merge(vol->mesh().transformed_bounding_box(inst_mat * vol->get_matrix()));
}
return bbox;
}
//BBS: add convex bounding box
BoundingBoxf3 ModelObject::instance_convex_hull_bounding_box(size_t instance_idx, bool dont_translate) const
{