mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 15:44:12 -06:00
Fix bed filling with more existing instances than needed
This commit is contained in:
parent
7f22ce63f6
commit
dfbf4cbab2
7 changed files with 49 additions and 16 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue