#6828 - Clamping of toolpaths width performed only for gcodes files produced by 3rd part softwares (Tech ENABLE_CLAMP_TOOLPATHS_WIDTH)

This commit is contained in:
enricoturri1966 2021-09-06 14:31:10 +02:00
parent ad41c3f01c
commit 7b4c98d727
2 changed files with 15 additions and 0 deletions

View File

@ -2252,8 +2252,14 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
// cross section: rectangle + 2 semicircles
m_width = delta_pos[E] * static_cast<float>(M_PI * sqr(filament_radius)) / (delta_xyz * m_height) + static_cast<float>(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);

View File

@ -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_