Skip to content

Commit

Permalink
Fix G2/G3 segment size
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and Emmanuel Viala committed Aug 21, 2020
1 parent 3b0603d commit c869e48
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Marlin/src/gcode/motion/G2_G3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c869e48

Please sign in to comment.