mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-25 15:47:25 +08:00
Fix status indication glitch for bed filling
This commit is contained in:
parent
4f7f08d0de
commit
4e90df1ea5
@ -55,18 +55,17 @@ void FillBedJob::prepare()
|
|||||||
double unsel_area = std::accumulate(m_unselected.begin(),
|
double unsel_area = std::accumulate(m_unselected.begin(),
|
||||||
m_unselected.end(), 0.,
|
m_unselected.end(), 0.,
|
||||||
[](double s, const auto &ap) {
|
[](double s, const auto &ap) {
|
||||||
return s + ap.poly.area();
|
return s + (ap.bed_idx == 0) * ap.poly.area();
|
||||||
}) / sc;
|
}) / sc;
|
||||||
|
|
||||||
double fixed_area = unsel_area + m_selected.size() * poly_area;
|
double fixed_area = unsel_area + m_selected.size() * poly_area;
|
||||||
|
|
||||||
// This is the maximum range, the real number will always be close but less.
|
|
||||||
double bed_area = Polygon{m_bedpts}.area() / sc;
|
double bed_area = Polygon{m_bedpts}.area() / sc;
|
||||||
|
|
||||||
m_status_range = (bed_area - fixed_area) / poly_area;
|
// This is the maximum number of items, the real number will always be close but less.
|
||||||
|
int needed_items = (bed_area - fixed_area) / poly_area;
|
||||||
|
|
||||||
ModelInstance *mi = model_object->instances[0];
|
ModelInstance *mi = model_object->instances[0];
|
||||||
for (int i = 0; i < m_status_range; ++i) {
|
for (int i = 0; i < needed_items; ++i) {
|
||||||
ArrangePolygon ap;
|
ArrangePolygon ap;
|
||||||
ap.poly = m_selected.front().poly;
|
ap.poly = m_selected.front().poly;
|
||||||
ap.bed_idx = arrangement::UNARRANGED;
|
ap.bed_idx = arrangement::UNARRANGED;
|
||||||
@ -77,6 +76,8 @@ void FillBedJob::prepare()
|
|||||||
};
|
};
|
||||||
m_selected.emplace_back(ap);
|
m_selected.emplace_back(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_status_range = m_selected.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FillBedJob::process()
|
void FillBedJob::process()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user