Selaa lähdekoodia

Fix for G2/G3 negative radius

As suggested in #4940
Scott Lahteine 8 vuotta sitten
vanhempi
commit
5c1eb595e6
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1
    1
      Marlin/Marlin_main.cpp

+ 1
- 1
Marlin/Marlin_main.cpp Näytä tiedosto

@@ -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…
Peruuta
Tallenna