From ba2662378cd70ae9b6f2b2bcb0654a7a412254e2 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 24 Nov 2021 10:24:11 +0100 Subject: [PATCH 1/4] Fixup of cc44089 (bed bounding box 2D vs 3D) The mentioned commit has changed behaviour of GLCanvas3D::get_size_proportional_to_max_bed_size(double) function so that it uses XYZ bounding box instead od just XY. As a result, adding a box object through the right panel added a huge box when printer max_print_z was higher than x/y. Offset at which a new object instance is added was also affected. --- src/slic3r/GUI/GLCanvas3D.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 1c7fc4a61e0..d5aee67adb9 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3751,7 +3751,8 @@ Linef3 GLCanvas3D::mouse_ray(const Point& mouse_pos) double GLCanvas3D::get_size_proportional_to_max_bed_size(double factor) const { - return factor * m_bed.build_volume().bounding_volume().max_size(); + const BoundingBoxf& bbox = m_bed.build_volume().bounding_volume2d(); + return factor * std::max(bbox.size()[0], bbox.size()[1]); } void GLCanvas3D::set_cursor(ECursorType type) From 29a3536536a1ec9c8a49323c135743b845267a2c Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 24 Nov 2021 11:48:52 +0100 Subject: [PATCH 2/4] Fix of objects have wrong color when using convex printbeds - SPE-1132 --- src/slic3r/GUI/GLCanvas3D.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 1c7fc4a61e0..49604d13838 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -5119,10 +5119,12 @@ void GLCanvas3D::_render_objects(GLVolumeCollection::ERenderType type) break; } default: + case BuildVolume::Type::Convex: case BuildVolume::Type::Custom: { m_volumes.set_print_volume({ static_cast(type), - { 0.0f, 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f } }); + { -FLT_MAX, -FLT_MAX, FLT_MAX, FLT_MAX }, + { -FLT_MAX, FLT_MAX } } + ); } } if (m_requires_check_outside_state) { From dd4f154afc19122c588f0e23bdeb42fb7965bb23 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 24 Nov 2021 11:55:52 +0100 Subject: [PATCH 3/4] Fixed warning --- src/slic3r/GUI/Mouse3DController.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Mouse3DController.cpp b/src/slic3r/GUI/Mouse3DController.cpp index 3ff0fdea321..e5ad5d64f40 100644 --- a/src/slic3r/GUI/Mouse3DController.cpp +++ b/src/slic3r/GUI/Mouse3DController.cpp @@ -468,9 +468,9 @@ void Mouse3DController::render_settings_dialog(GLCanvas3D& canvas) const ImGui::Separator(); imgui.text_colored(color, _L("Speed:")); - float translation_scale = (float)params_copy.translation.scale / Params::DefaultTranslationScale; - if (imgui.slider_float(_L("Translation"), &translation_scale, Params::MinTranslationScale, Params::MaxTranslationScale, "%.1f")) { - params_copy.translation.scale = Params::DefaultTranslationScale * (double)translation_scale; + float translation_scale = float(params_copy.translation.scale) / float(Params::DefaultTranslationScale); + if (imgui.slider_float(_L("Translation"), &translation_scale, float(Params::MinTranslationScale), float(Params::MaxTranslationScale), "%.1f")) { + params_copy.translation.scale = Params::DefaultTranslationScale * double(translation_scale); params_changed = true; } From 3ed2fa0bce509a0b5df13410e7e059a5fdae0173 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 24 Nov 2021 12:31:27 +0100 Subject: [PATCH 4/4] Fix of missing update after changing the value of Max print height into Printer settings tab - SPE-1133 --- src/slic3r/GUI/3DBed.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index a8d7dbdf25c..bd5ca9f5212 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -174,7 +174,7 @@ bool Bed3D::set_shape(const Pointfs& bed_shape, const double max_print_height, c } - if (m_build_volume.bed_shape() == bed_shape && m_type == type && m_texture_filename == texture_filename && m_model_filename == model_filename) + if (m_build_volume.bed_shape() == bed_shape && m_build_volume.max_print_height() == max_print_height && m_type == type && m_texture_filename == texture_filename && m_model_filename == model_filename) // No change, no need to update the UI. return false; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 7cbaa9d0853..9049bbf381a 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -6284,8 +6284,10 @@ void Plater::on_config_change(const DynamicPrintConfig &config) update_scheduled = true; p->sidebar->obj_list()->update_extruder_colors(); } - else if(opt_key == "max_print_height") + else if (opt_key == "max_print_height") { + bed_shape_changed = true; update_scheduled = true; + } else if (opt_key == "printer_model") { p->reset_gcode_toolpaths(); // update to force bed selection(for texturing)