Sfoglia il codice sorgente

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

Robby Candra 4 anni fa
parent
commit
e79666a82b
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2
    2
      Marlin/src/gcode/motion/G2_G3.cpp

+ 2
- 2
Marlin/src/gcode/motion/G2_G3.cpp Vedi File

@@ -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…
Annulla
Salva