Disable slicing when one object crosses the print volume boundary

This commit is contained in:
Enrico Turri 2018-07-18 14:26:42 +02:00
parent d672a69554
commit d805c8ac3b
9 changed files with 67 additions and 29 deletions

View file

@ -1235,7 +1235,7 @@ void ModelObject::split(ModelObjectPtrs* new_objects)
return;
}
void ModelObject::check_instances_printability(const BoundingBoxf3& print_volume)
void ModelObject::check_instances_print_volume_state(const BoundingBoxf3& print_volume)
{
for (ModelVolume* vol : this->volumes)
{
@ -1274,10 +1274,15 @@ void ModelObject::check_instances_printability(const BoundingBoxf3& print_volume
p.y += inst->offset.y;
bb.merge(p);
inst->is_printable = print_volume.contains(bb);
}
}
if (print_volume.contains(bb))
inst->print_volume_state = ModelInstance::PVS_Inside;
else if (print_volume.intersects(bb))
inst->print_volume_state = ModelInstance::PVS_Partly_Outside;
else
inst->print_volume_state = ModelInstance::PVS_Fully_Outside;
}
}
}