From ea769776027ef6233af5963bfa699e4c62f4e473 Mon Sep 17 00:00:00 2001 From: PavelMikus Date: Thu, 28 Jul 2022 15:47:34 +0200 Subject: [PATCH] Quick fix for invalidation of support spots search --- src/libslic3r/PrintApply.cpp | 4 +++- src/libslic3r/PrintObject.cpp | 2 +- src/libslic3r/SupportSpotsGenerator.hpp | 2 +- src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp | 11 ++++++++++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp index 4c085728c..2a5b14c7e 100644 --- a/src/libslic3r/PrintApply.cpp +++ b/src/libslic3r/PrintApply.cpp @@ -1194,8 +1194,10 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ update_apply_status(false); } // Invalidate just the supports step. - for (const PrintObjectStatus &print_object_status : print_objects_range) + for (const PrintObjectStatus &print_object_status : print_objects_range) { + update_apply_status(print_object_status.print_object->invalidate_step(posSupportSpotsSearch)); update_apply_status(print_object_status.print_object->invalidate_step(posSupportMaterial)); + } if (supports_differ) { // Copy just the support volumes. model_volume_list_update_supports(model_object, model_object_new); diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 2d473415c..59fbcc99d 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -436,7 +436,7 @@ void PrintObject::generate_support_spots() Vec3f point = Vec3f(inv_transform * support_point.position); Vec3f origin = Vec3f( inv_transform * Vec3f(support_point.position.x(), support_point.position.y(), 0.0f)); - selector.enforce_spot(point, origin, 0.6f); + selector.enforce_spot(point, origin, 1.0f); } model_volume->supported_facets.set(selector.selector); diff --git a/src/libslic3r/SupportSpotsGenerator.hpp b/src/libslic3r/SupportSpotsGenerator.hpp index 6b94ceeaa..6e435faa3 100644 --- a/src/libslic3r/SupportSpotsGenerator.hpp +++ b/src/libslic3r/SupportSpotsGenerator.hpp @@ -13,7 +13,7 @@ struct Params { const float bridge_distance_decrease_by_curvature_factor = 3.0f; // allowed bridge distance = bridge_distance / (this factor * (curvature / PI) ) const float min_distance_between_support_points = 3.0f; //mm - const float support_points_interface_radius = 0.6f; // mm + const float support_points_interface_radius = 1.0f; // mm const float gravity_constant = 9806.65f; // mm/s^2; gravity acceleration on Earth's surface, algorithm assumes that printer is in upwards position. const float max_acceleration = 9*1000.0f; // mm/s^2 ; max acceleration of object (bed) in XY (NOTE: The max hit is received by the object in the jerk phase, so the usual machine limits are too low) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp index 494adb55a..c193dbf90 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp @@ -414,7 +414,6 @@ void GLGizmoFdmSupports::get_data_from_backend() if (mv->is_model_part()){ mesh_id++; mv->supported_facets.assign(mvs[mv->id().id]->supported_facets); - mv->supported_facets.touch(); m_triangle_selectors[mesh_id]->deserialize(mv->supported_facets.get_data(), true); m_triangle_selectors[mesh_id]->request_update_render_data(); } @@ -510,6 +509,16 @@ void GLGizmoFdmSupports::auto_generate() if (not_painted || dlg.ShowModal() == wxID_YES) { Plater::TakeSnapshot snapshot(wxGetApp().plater(), _L("Autogenerate support points")); + int mesh_id = -1.0f; + for (ModelVolume *mv : mo->volumes) { + if (mv->is_model_part()) { + mesh_id++; + mv->supported_facets.reset(); + m_triangle_selectors[mesh_id]->reset(); + m_triangle_selectors[mesh_id]->request_update_render_data(); + } + } + this->waiting_for_autogenerated_supports = true; wxGetApp().CallAfter([this]() { reslice_FDM_supports(); }); }