소스 검색

Followup to "Fix G2/G3 rounding" (#15510)

Robby Candra 5 년 전
부모
커밋
e79666a82b
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2
    2
      Marlin/src/gcode/motion/G2_G3.cpp

+ 2
- 2
Marlin/src/gcode/motion/G2_G3.cpp 파일 보기

@@ -290,8 +290,8 @@ void GcodeSuite::G2_G3(const bool clockwise) {
290 290
                       len = d2.magnitude(),              // Distance to mid-point of move from current
291 291
                       h2 = (r - len) * (r + len),        // factored to reduce rounding error
292 292
                       h = (h2 >= 0) ? SQRT(h2) : 0.0f;   // Distance to the arc pivot-point from midpoint
293
-          const xy_pos_t s = { -d2.y, d2.x } / len;      // Unit vector along perpendicular bisector
294
-          arc_offset = d2 + s * e * h;                   // The calculated offset (mid-point if |r| <= len)
293
+          const xy_pos_t s = { -d2.y, d2.x };            // Perpendicular bisector. (Divide by len for unit vector.)
294
+          arc_offset = d2 + s / len * e * h;             // The calculated offset (mid-point if |r| <= len)
295 295
         }
296 296
       }
297 297
     }

Loading…
취소
저장