Attempt to speed up outside bed detection (#8869)
* Don't check intersection if points below bed is also inside the bed, when the bed is convex * Skip intersection check if bbox not overlapping * Remove duplicated out of bed check * Faster (but less accurate) bbox test * Merge branch 'main' into dev/faster-outside-check # Conflicts: # src/libslic3r/Model.cpp
This commit is contained in:
@@ -3317,7 +3317,14 @@ ModelInstanceEPrintVolumeState ModelInstance::calc_print_volume_state(const Buil
|
||||
}
|
||||
|
||||
const Transform3d matrix = this->get_matrix() * vol->get_matrix();
|
||||
BuildVolume::ObjectState state = build_volume.object_state(vol->mesh().its, matrix.cast<float>(), true /* may be below print bed */);
|
||||
|
||||
const auto bboxt = bb.transformed(matrix);
|
||||
const BoundingBoxf bbox2d{to_2d(bboxt.min), to_2d(bboxt.max)};
|
||||
BuildVolume::ObjectState state;
|
||||
if (!build_volume.bounding_volume2d().inflated(BuildVolume::SceneEpsilon).overlap(bbox2d))
|
||||
state = BuildVolume::ObjectState::Outside;
|
||||
else
|
||||
state = build_volume.object_state(vol->mesh().its, matrix.cast<float>(), true /* may be below print bed */);
|
||||
if (state == BuildVolume::ObjectState::Inside)
|
||||
// Volume is completely inside.
|
||||
inside_outside |= INSIDE;
|
||||
|
||||
Reference in New Issue
Block a user