mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-18 21:49:04 -07:00
Fix bed filling with more existing instances than needed
This commit is contained in:
@@ -741,6 +741,10 @@ public:
|
||||
return impl_.getResult();
|
||||
}
|
||||
|
||||
inline int lastPackedBinId() const {
|
||||
return impl_.lastPackedBinId();
|
||||
}
|
||||
|
||||
void clear() { impl_.clear(); }
|
||||
};
|
||||
|
||||
@@ -862,6 +866,10 @@ public:
|
||||
{
|
||||
return selector_.getResult();
|
||||
}
|
||||
|
||||
inline int lastPackedBinId() const {
|
||||
return selector_.lastPackedBinId();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -71,8 +71,9 @@ public:
|
||||
std::sort(store_.begin(), store_.end(), sortfunc);
|
||||
|
||||
auto total = last-first;
|
||||
auto makeProgress = [this, &total](Placer& placer, size_t idx) {
|
||||
packed_bins_[idx] = placer.getItems();
|
||||
auto makeProgress = [this, &total](Placer& placer, size_t bin_idx) {
|
||||
packed_bins_[bin_idx] = placer.getItems();
|
||||
this->last_packed_bin_id_ = int(bin_idx);
|
||||
this->progress_(static_cast<unsigned>(--total));
|
||||
};
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ public:
|
||||
return packed_bins_;
|
||||
}
|
||||
|
||||
inline int lastPackedBinId() const { return last_packed_bin_id_; }
|
||||
|
||||
inline void progressIndicator(ProgressFunction fn) { progress_ = fn; }
|
||||
|
||||
inline void stopCondition(StopCondition cond) { stopcond_ = cond; }
|
||||
@@ -54,6 +56,7 @@ protected:
|
||||
PackGroup packed_bins_;
|
||||
ProgressFunction progress_ = [](unsigned){};
|
||||
StopCondition stopcond_ = [](){ return false; };
|
||||
int last_packed_bin_id_ = -1;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user