From eb1518bf312aee6ddebe493dea06816cdc3313e0 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Mon, 10 Dec 2018 13:57:43 +0100 Subject: [PATCH] Removed out of bed detection for sla pad --- src/slic3r/GUI/3DScene.cpp | 26 +++++++++++++------------- src/slic3r/GUI/GLCanvas3D.cpp | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index ac9755e1c..09c3443c3 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -870,8 +870,8 @@ void GLVolumeCollection::load_object_auxiliary( // Create a copy of the convex hull mesh for each instance. Use a move operator on the last instance. v.set_convex_hull((&instance_idx == &instances.back()) ? new TriangleMesh(std::move(convex_hull)) : new TriangleMesh(convex_hull), true); v.is_modifier = false; - v.shader_outside_printer_detection_enabled = true; - v.set_instance_transformation(model_instance.get_transformation()); + v.shader_outside_printer_detection_enabled = (milestone == slaposSupportTree); + v.set_instance_transformation(model_instance.get_transformation()); // Leave the volume transformation at identity. // v.set_volume_transformation(model_volume->get_transformation()); } @@ -1039,20 +1039,20 @@ bool GLVolumeCollection::check_outside_state(const DynamicPrintConfig* config, M for (GLVolume* volume : this->volumes) { - if ((volume != nullptr) && !volume->is_modifier && (!volume->is_wipe_tower || (volume->is_wipe_tower && volume->shader_outside_printer_detection_enabled))) - { - const BoundingBoxf3& bb = volume->transformed_convex_hull_bounding_box(); - bool contained = print_volume.contains(bb); - all_contained &= contained; + if ((volume == nullptr) || volume->is_modifier || (volume->is_wipe_tower && !volume->shader_outside_printer_detection_enabled) || ((volume->composite_id.volume_id < 0) && !volume->shader_outside_printer_detection_enabled)) + continue; - volume->is_outside = !contained; + const BoundingBoxf3& bb = volume->transformed_convex_hull_bounding_box(); + bool contained = print_volume.contains(bb); + all_contained &= contained; - if ((state == ModelInstance::PVS_Inside) && volume->is_outside) - state = ModelInstance::PVS_Fully_Outside; + volume->is_outside = !contained; - if ((state == ModelInstance::PVS_Fully_Outside) && volume->is_outside && print_volume.intersects(bb)) - state = ModelInstance::PVS_Partly_Outside; - } + if ((state == ModelInstance::PVS_Inside) && volume->is_outside) + state = ModelInstance::PVS_Fully_Outside; + + if ((state == ModelInstance::PVS_Fully_Outside) && volume->is_outside && print_volume.intersects(bb)) + state = ModelInstance::PVS_Partly_Outside; } if (out_state != nullptr) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 726cda46d..721969fa5 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -7479,7 +7479,7 @@ void GLCanvas3D::_load_shells_sla() else v.indexed_vertex_array.load_mesh_flat_shading(mesh); - v.shader_outside_printer_detection_enabled = true; + v.shader_outside_printer_detection_enabled = false; v.composite_id.volume_id = -1; v.set_instance_offset(offset); v.set_instance_rotation(rotation);