Tech ENABLE_FIX_SINKING_OBJECT_OUT_OF_BED_DETECTION merged into tech ENABLE_OUT_OF_BED_DETECTION_IMPROVEMENTS

This commit is contained in:
enricoturri1966 2021-10-01 13:13:26 +02:00
parent efb08cf55a
commit f84838028b
6 changed files with 18 additions and 32 deletions
src/libslic3r

View file

@ -1567,11 +1567,7 @@ unsigned int ModelObject::check_instances_print_volume_state(const Polygon& prin
for (const ModelVolume* vol : this->volumes)
if (vol->is_model_part()) {
const Transform3d matrix = model_instance->get_matrix() * vol->get_matrix();
#if ENABLE_FIX_SINKING_OBJECT_OUT_OF_BED_DETECTION
const BoundingBoxf3 bb = vol->mesh().transformed_bounding_box(matrix, 0.0);
#else
const BoundingBoxf3 bb = vol->get_convex_hull().transformed_bounding_box(matrix);
#endif // ENABLE_FIX_SINKING_OBJECT_OUT_OF_BED_DETECTION
const Polygon volume_hull_2d = its_convex_hull_2d_above(vol->mesh().its, matrix.cast<float>(), 0.0f);
ModelInstanceEPrintVolumeState state = printbed_collision_state(printbed_shape, print_volume_height, volume_hull_2d, bb.min.z(), bb.max.z());
if (state == ModelInstancePVS_Inside)
@ -1601,11 +1597,7 @@ unsigned int ModelObject::check_instances_print_volume_state(const BoundingBoxf3
unsigned int inside_outside = 0;
for (const ModelVolume *vol : this->volumes)
if (vol->is_model_part()) {
#if ENABLE_FIX_SINKING_OBJECT_OUT_OF_BED_DETECTION
BoundingBoxf3 bb = vol->mesh().transformed_bounding_box(model_instance->get_matrix() * vol->get_matrix(), 0.0);
#else
BoundingBoxf3 bb = vol->get_convex_hull().transformed_bounding_box(model_instance->get_matrix() * vol->get_matrix());
#endif // ENABLE_FIX_SINKING_OBJECT_OUT_OF_BED_DETECTION
if (print_volume.contains(bb))
inside_outside |= INSIDE;
else if (print_volume.intersects(bb))