From ad41c3f01c94f888e500462e4127574f1fc60766 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 6 Sep 2021 13:15:36 +0200 Subject: [PATCH 1/2] Tech ENABLE_SEAMS_USING_MODELS - Fixed crash when enabling visualization of tool change markers in preview --- src/slic3r/GUI/GCodeViewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 656a67406..8c2ef573f 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -2399,7 +2399,7 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool buffer.model.instances.render_ranges.reset(); - if (!buffer.visible) + if (!buffer.visible || buffer.model.instances.s_ids.empty()) continue; buffer.model.instances.render_ranges.ranges.push_back({ 0, 0, 0, buffer.model.color }); From 7b4c98d72704a86acc99eb57837fd3bcb941f981 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 6 Sep 2021 14:31:10 +0200 Subject: [PATCH 2/2] #6828 - Clamping of toolpaths width performed only for gcodes files produced by 3rd part softwares (Tech ENABLE_CLAMP_TOOLPATHS_WIDTH) --- src/libslic3r/GCode/GCodeProcessor.cpp | 6 ++++++ src/libslic3r/Technologies.hpp | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 73ee0d164..c4f262675 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2252,8 +2252,14 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line) // cross section: rectangle + 2 semicircles m_width = delta_pos[E] * static_cast(M_PI * sqr(filament_radius)) / (delta_xyz * m_height) + static_cast(1.0 - 0.25 * M_PI) * m_height; +#if ENABLE_CLAMP_TOOLPATHS_WIDTH + if (m_producers_enabled && m_producer != EProducer::PrusaSlicer) + // clamp width to avoid artifacts which may arise from wrong values of m_height + m_width = std::min(m_width, std::max(1.0f, 4.0f * m_height)); +#else // clamp width to avoid artifacts which may arise from wrong values of m_height m_width = std::min(m_width, std::max(1.0f, 4.0f * m_height)); +#endif // ENABLE_CLAMP_TOOLPATHS_WIDTH #if ENABLE_GCODE_VIEWER_DATA_CHECKING m_width_compare.update(m_width, m_extrusion_role); diff --git a/src/libslic3r/Technologies.hpp b/src/libslic3r/Technologies.hpp index 6132430f1..405119fc0 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -57,4 +57,13 @@ #define ENABLE_SAVE_COMMANDS_ALWAYS_ENABLED (1 && ENABLE_2_4_0_ALPHA0) +//==================== +// 2.4.0.alpha2 techs +//==================== +#define ENABLE_2_4_0_ALPHA2 1 + +// Enable clamping toolpaths width only for gcodes files produced by 3rd part softwares +#define ENABLE_CLAMP_TOOLPATHS_WIDTH (1 && ENABLE_2_4_0_ALPHA2) + + #endif // _prusaslicer_technologies_h_