From b6d3083ce7546090100ec66ee1ac14a284d6d1fc Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Wed, 22 Sep 2021 10:50:04 +0200 Subject: [PATCH 1/2] Fixed crash with zero support base spacing. Zero support base spacing is newly allowed, switching from the "support base" infill pattern to rectilinar infill pattern. Why someone would want to use a solid infill for support base eludes me, but it is simpler to support it instead of working out some rules on minimum support base density. Fixes Support patern spacing set to zero causing crash #6989 --- src/libslic3r/SupportMaterial.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/SupportMaterial.cpp b/src/libslic3r/SupportMaterial.cpp index f727d334d9c..2bcf99c57e4 100644 --- a/src/libslic3r/SupportMaterial.cpp +++ b/src/libslic3r/SupportMaterial.cpp @@ -721,9 +721,9 @@ public: #ifdef SUPPORT_USE_AGG_RASTERIZER m_bbox = bbox; // Oversample the grid to avoid leaking of supports through or around the object walls. - int oversampling = std::min(8, int(scale_(m_support_spacing) / (scale_(params.extrusion_width) + 100))); - m_pixel_size = scale_(m_support_spacing / oversampling); - assert(scale_(params.extrusion_width) + 20 < m_pixel_size); + int extrusion_width_scaled = scale_(params.extrusion_width); + int oversampling = std::clamp(int(scale_(m_support_spacing) / (extrusion_width_scaled + 100)), 1, 8); + m_pixel_size = std::max(extrusion_width_scaled + 21, scale_(m_support_spacing / oversampling)); // Add one empty column / row boundaries. m_bbox.offset(m_pixel_size); // Grid size fitting the support polygons plus one pixel boundary around the polygons. @@ -2600,8 +2600,6 @@ void PrintObjectSupportMaterial::generate_base_layers( // No top contacts -> no intermediate layers will be produced. return; - // coordf_t fillet_radius_scaled = scale_(m_object_config->support_material_spacing); - BOOST_LOG_TRIVIAL(debug) << "PrintObjectSupportMaterial::generate_base_layers() in parallel - start"; tbb::parallel_for( tbb::blocked_range(0, intermediate_layers.size()), @@ -2696,6 +2694,7 @@ void PrintObjectSupportMaterial::generate_base_layers( layer_intermediate.layer_type = sltBase; #if 0 + // coordf_t fillet_radius_scaled = scale_(m_object_config->support_material_spacing); // Fillet the base polygons and trim them again with the top, interface and contact layers. $base->{$i} = diff( offset2( @@ -3784,7 +3783,7 @@ void PrintObjectSupportMaterial::generate_toolpaths( // Prepare fillers. SupportMaterialPattern support_pattern = m_object_config->support_material_pattern; bool with_sheath = m_object_config->support_material_with_sheath; - InfillPattern infill_pattern = (support_pattern == smpHoneycomb ? ipHoneycomb : ipSupportBase); + InfillPattern infill_pattern = support_pattern == smpHoneycomb ? ipHoneycomb : (support_density < 1.05 ? ipRectilinear : ipSupportBase); std::vector angles; angles.push_back(base_angle); From f5359c281ecfeb5f258c23ca47b677b6a04a7ae5 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Tue, 21 Sep 2021 09:31:15 +0200 Subject: [PATCH 2/2] Fix of #6898 (finishing slicing interfered with dragging gizmos) --- src/slic3r/GUI/Plater.cpp | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 4ffa7dc134f..e76ff244996 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3918,20 +3918,16 @@ void Plater::priv::on_slicing_update(SlicingStatusEvent &evt) void Plater::priv::on_slicing_completed(wxCommandEvent & evt) { - switch (this->printer_technology) { - case ptFFF: - this->update_fff_scene(); - break; - case ptSLA: - if (view3D->is_dragging()) - delayed_scene_refresh = true; + if (view3D->is_dragging()) // updating scene now would interfere with the gizmo dragging + delayed_scene_refresh = true; + else { + if (this->printer_technology == ptFFF) + this->update_fff_scene(); else this->update_sla_scene(); - break; - default: break; } - } + void Plater::priv::on_export_began(wxCommandEvent& evt) { if (show_warning_dialog) @@ -4050,17 +4046,13 @@ void Plater::priv::on_process_completed(SlicingProcessCompletedEvent &evt) this->object_list_changed(); // refresh preview - switch (this->printer_technology) { - case ptFFF: - this->update_fff_scene(); - break; - case ptSLA: - if (view3D->is_dragging()) - delayed_scene_refresh = true; + if (view3D->is_dragging()) // updating scene now would interfere with the gizmo dragging + delayed_scene_refresh = true; + else { + if (this->printer_technology == ptFFF) + this->update_fff_scene(); else this->update_sla_scene(); - break; - default: break; } if (evt.cancelled()) {