mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-15 04:56:14 +08:00
allow >1mm width extrusions in gcode viewer
supermerill/SuperSlicer#840 there is now a width limit at 10*height if guessed width-height gcode
This commit is contained in:
parent
cdd0a728f1
commit
f6c663cc70
@ -1903,8 +1903,10 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||||||
#if ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE
|
#if ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE
|
||||||
if (m_forced_width > 0.0f)
|
if (m_forced_width > 0.0f)
|
||||||
m_width = m_forced_width;
|
m_width = m_forced_width;
|
||||||
else if (m_extrusion_role == erExternalPerimeter)
|
else {
|
||||||
|
if (m_extrusion_role == erExternalPerimeter)
|
||||||
#else
|
#else
|
||||||
|
{
|
||||||
if (m_extrusion_role == erExternalPerimeter)
|
if (m_extrusion_role == erExternalPerimeter)
|
||||||
#endif // ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE
|
#endif // ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE
|
||||||
// cross section: rectangle
|
// cross section: rectangle
|
||||||
@ -1916,8 +1918,12 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||||||
// cross section: rectangle + 2 semicircles
|
// 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;
|
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;
|
||||||
|
|
||||||
// clamp width to avoid artifacts which may arise from wrong values of m_height
|
// if teh value seems wrong, fall back to circular extrusion from flow
|
||||||
m_width = std::min(m_width, std::max(1.0f, 4.0f * m_height));
|
if (m_width > m_height * 10 || m_width < m_height) {
|
||||||
|
m_width = 2 * std::sqrt(m_mm3_per_mm / float(PI));
|
||||||
|
m_height = m_width;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
|
||||||
m_width_compare.update(m_width, m_extrusion_role);
|
m_width_compare.update(m_width, m_extrusion_role);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user