mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
ENH: allow generate wipe tower when print ByObject
allow generate wipe tower when print ByObject if there is only one object Change-Id: I199e9cab7bd7c963edf58e829c663bb91c12f4f8 (cherry picked from commit 7153c30800022f3afb9811c67f88ba28c9b25d20)
This commit is contained in:
parent
1c5c9bd3d2
commit
93b1a335d2
7 changed files with 38 additions and 9 deletions
|
@ -1729,6 +1729,26 @@ void PartPlate::update_object_index(int obj_idx_removed, int obj_idx_max)
|
|||
|
||||
}
|
||||
|
||||
int PartPlate::printable_instance_size()
|
||||
{
|
||||
int size = 0;
|
||||
for (std::set<std::pair<int, int>>::iterator it = obj_to_instance_set.begin(); it != obj_to_instance_set.end(); ++it) {
|
||||
int obj_id = it->first;
|
||||
int instance_id = it->second;
|
||||
|
||||
if (obj_id >= m_model->objects.size())
|
||||
continue;
|
||||
|
||||
ModelObject * object = m_model->objects[obj_id];
|
||||
ModelInstance *instance = object->instances[instance_id];
|
||||
|
||||
if ((instance->printable) && (instance_outside_set.find(std::pair(obj_id, instance_id)) == instance_outside_set.end())) {
|
||||
size++;
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
//whether it is has printable instances
|
||||
bool PartPlate::has_printable_instances()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue