mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 14:44:19 -06:00
Fix for bed filling with some existing items out of bed.
This commit is contained in:
parent
4e90df1ea5
commit
2813db8906
3 changed files with 30 additions and 3 deletions
|
@ -29,7 +29,9 @@ void FillBedJob::prepare()
|
|||
for (ModelInstance *inst : model_object->instances)
|
||||
if (inst->printable) {
|
||||
ArrangePolygon ap = get_arrange_poly(PtrWrapper{inst}, m_plater);
|
||||
++ap.priority; // need to be included in the result
|
||||
// Existing objects need to be included in the result. Only
|
||||
// the needed amount of object will be added, no more.
|
||||
++ap.priority;
|
||||
m_selected.emplace_back(ap);
|
||||
}
|
||||
|
||||
|
@ -38,11 +40,18 @@ void FillBedJob::prepare()
|
|||
m_bedpts = get_bed_shape(*m_plater->config());
|
||||
|
||||
auto &objects = m_plater->model().objects;
|
||||
BoundingBox bedbb = get_extents(m_bedpts);
|
||||
|
||||
for (size_t idx = 0; idx < objects.size(); ++idx)
|
||||
if (int(idx) != m_object_idx)
|
||||
for (ModelInstance *mi : objects[idx]->instances) {
|
||||
m_unselected.emplace_back(get_arrange_poly(PtrWrapper{mi}, m_plater));
|
||||
m_unselected.back().bed_idx = 0;
|
||||
ArrangePolygon ap = get_arrange_poly(PtrWrapper{mi}, m_plater);
|
||||
auto ap_bb = ap.transformed_poly().contour.bounding_box();
|
||||
|
||||
if (ap.bed_idx == 0 && !bedbb.contains(ap_bb))
|
||||
ap.bed_idx = arrangement::UNARRANGED;
|
||||
|
||||
m_unselected.emplace_back(ap);
|
||||
}
|
||||
|
||||
if (auto wt = get_wipe_tower_arrangepoly(*m_plater))
|
||||
|
@ -78,6 +87,12 @@ void FillBedJob::prepare()
|
|||
}
|
||||
|
||||
m_status_range = m_selected.size();
|
||||
|
||||
// The strides have to be removed from the fixed items. For the
|
||||
// arrangeable (selected) items bed_idx is ignored and the
|
||||
// translation is irrelevant.
|
||||
double stride = bed_stride(m_plater);
|
||||
for (auto &p : m_unselected) p.translation(X) -= p.bed_idx * stride;
|
||||
}
|
||||
|
||||
void FillBedJob::process()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue