From de6a725b04f9005fa53fab240edb3d2c576a6c97 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 May 2020 02:46:37 -0500 Subject: [PATCH] Fix G2/G3 segment size Fixes #17348 --- Marlin/src/gcode/motion/G2_G3.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index 1e8365d6d2..0352947cca 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -112,8 +112,13 @@ void plan_arc( #else constexpr float seg_length = MM_PER_ARC_SEGMENT; #endif + + // Length divided by segment size gives segment count uint16_t segments = FLOOR(mm_of_travel / seg_length); - NOLESS(segments, min_segments); + if (segments < min_segments) { + segments = min_segments; // No fewer than the minimum + seg_length = mm_of_travel / segments; // A new segment length + } /** * Vector rotation by transformation matrix: r is the original vector, r_T is the rotated vector,