瀏覽代碼

Fix for G2/G3 negative radius

As suggested in #4940
Scott Lahteine 8 年之前
父節點
當前提交
5c1eb595e6
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      Marlin/Marlin_main.cpp

+ 1
- 1
Marlin/Marlin_main.cpp 查看文件

@@ -2796,7 +2796,7 @@ inline void gcode_G0_G1(
2796 2796
                     x1 = current_position[X_AXIS], y1 = current_position[Y_AXIS],
2797 2797
                     x2 = destination[X_AXIS], y2 = destination[Y_AXIS];
2798 2798
         if (r && (x2 != x1 || y2 != y1)) {
2799
-          const float e = clockwise ? -1 : 1,                     // clockwise -1, counterclockwise 1
2799
+          const float e = clockwise ^ (r < 0) ? -1 : 1,           // clockwise -1/1, counterclockwise 1/-1
2800 2800
                       dx = x2 - x1, dy = y2 - y1,                 // X and Y differences
2801 2801
                       d = HYPOT(dx, dy),                          // Linear distance between the points
2802 2802
                       h = sqrt(sq(r) - sq(d * 0.5)),              // Distance to the arc pivot-point

Loading…
取消
儲存