ENH: should apply instance shift in is_through_overhang

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: I07ca04d459c3e98650c8e5a33f56dac20f99b9a2
This commit is contained in:
salt.wei 2023-07-05 10:21:05 +08:00 committed by Lane.Wei
parent c00719b837
commit bc0273d734
4 changed files with 53 additions and 30 deletions

View file

@ -437,7 +437,7 @@ bool Print::has_brim() const
}
//BBS
std::vector<size_t> Print::layers_sorted_for_object(float start, float end, std::vector<LayerPtrs> &layers_of_objects, std::vector<BoundingBox> &boundingBox_for_objects)
std::vector<size_t> Print::layers_sorted_for_object(float start, float end, std::vector<LayerPtrs> &layers_of_objects, std::vector<BoundingBox> &boundingBox_for_objects, std::vector<Points> &objects_instances_shift)
{
std::vector<size_t> idx_of_object_sorted;
size_t idx = 0;
@ -448,6 +448,11 @@ std::vector<size_t> Print::layers_sorted_for_object(float start, float end, std:
std::sort(idx_of_object_sorted.begin(), idx_of_object_sorted.end(),
[boundingBox_for_objects](auto left, auto right) { return boundingBox_for_objects[left].area() > boundingBox_for_objects[right].area(); });
objects_instances_shift.clear();
objects_instances_shift.reserve(m_objects.size());
for (const auto& object : m_objects)
objects_instances_shift.emplace_back(object->get_instances_shift_without_plate_offset());
return idx_of_object_sorted;
};