Преглед изворни кода

Fix Planner::unskew parity with skew

Scott Lahteine пре 7 година
родитељ
комит
368c124de8
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3
    3
      Marlin/src/module/planner.h

+ 3
- 3
Marlin/src/module/planner.h Прегледај датотеку

353
 
353
 
354
       FORCE_INLINE static void skew(float &cx, float &cy, const float &cz) {
354
       FORCE_INLINE static void skew(float &cx, float &cy, const float &cz) {
355
         if (WITHIN(cx, X_MIN_POS + 1, X_MAX_POS) && WITHIN(cy, Y_MIN_POS + 1, Y_MAX_POS)) {
355
         if (WITHIN(cx, X_MIN_POS + 1, X_MAX_POS) && WITHIN(cy, Y_MIN_POS + 1, Y_MAX_POS)) {
356
-          const float sx = cx - (cy * xy_skew_factor) - (cz * (xz_skew_factor - (xy_skew_factor * yz_skew_factor))),
357
-                      sy = cy - (cz * yz_skew_factor);
356
+          const float sx = cx - cy * xy_skew_factor - cz * (xz_skew_factor - (xy_skew_factor * yz_skew_factor)),
357
+                      sy = cy - cz * yz_skew_factor;
358
           if (WITHIN(sx, X_MIN_POS, X_MAX_POS) && WITHIN(sy, Y_MIN_POS, Y_MAX_POS)) {
358
           if (WITHIN(sx, X_MIN_POS, X_MAX_POS) && WITHIN(sy, Y_MIN_POS, Y_MAX_POS)) {
359
             cx = sx; cy = sy;
359
             cx = sx; cy = sy;
360
           }
360
           }
363
 
363
 
364
       FORCE_INLINE static void unskew(float &cx, float &cy, const float &cz) {
364
       FORCE_INLINE static void unskew(float &cx, float &cy, const float &cz) {
365
         if (WITHIN(cx, X_MIN_POS, X_MAX_POS) && WITHIN(cy, Y_MIN_POS, Y_MAX_POS)) {
365
         if (WITHIN(cx, X_MIN_POS, X_MAX_POS) && WITHIN(cy, Y_MIN_POS, Y_MAX_POS)) {
366
-          const float sx = cx + cy * xy_skew_factor + cz * xz_skew_factor,
366
+          const float sx = cx + cy * xy_skew_factor + cz * (xz_skew_factor - (xy_skew_factor * yz_skew_factor)),
367
                       sy = cy + cz * yz_skew_factor;
367
                       sy = cy + cz * yz_skew_factor;
368
           if (WITHIN(sx, X_MIN_POS, X_MAX_POS) && WITHIN(sy, Y_MIN_POS, Y_MAX_POS)) {
368
           if (WITHIN(sx, X_MIN_POS, X_MAX_POS) && WITHIN(sy, Y_MIN_POS, Y_MAX_POS)) {
369
             cx = sx; cy = sy;
369
             cx = sx; cy = sy;

Loading…
Откажи
Сачувај