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 fd7609e77..a674255f0 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -62,6 +62,8 @@ //==================== #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) // Enable coloring of toolpaths in preview by layer time #define ENABLE_PREVIEW_LAYER_TIME (1 && ENABLE_2_4_0_ALPHA2) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index d909f8ac2..3d7d75427 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -2434,7 +2434,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 });