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

Make probed points more symmetrical

Scott Lahteine пре 9 година
родитељ
комит
55355a4fb8
1 измењених фајлова са 6 додато и 4 уклоњено
  1. 6
    4
      Marlin/Marlin_main.cpp

+ 6
- 4
Marlin/Marlin_main.cpp Прегледај датотеку

3609
     #if ENABLED(AUTO_BED_LEVELING_GRID)
3609
     #if ENABLED(AUTO_BED_LEVELING_GRID)
3610
 
3610
 
3611
       // probe at the points of a lattice grid
3611
       // probe at the points of a lattice grid
3612
-      const int xGridSpacing = (right_probe_bed_position - left_probe_bed_position) / (auto_bed_leveling_grid_points - 1),
3613
-                yGridSpacing = (back_probe_bed_position - front_probe_bed_position) / (auto_bed_leveling_grid_points - 1);
3612
+      const float xGridSpacing = (right_probe_bed_position - left_probe_bed_position) / (auto_bed_leveling_grid_points - 1),
3613
+                  yGridSpacing = (back_probe_bed_position - front_probe_bed_position) / (auto_bed_leveling_grid_points - 1);
3614
 
3614
 
3615
       #if ENABLED(DELTA)
3615
       #if ENABLED(DELTA)
3616
         delta_grid_spacing[X_AXIS] = xGridSpacing;
3616
         delta_grid_spacing[X_AXIS] = xGridSpacing;
3639
       bool zig = (auto_bed_leveling_grid_points & 1) ? true : false; //always end at [RIGHT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION]
3639
       bool zig = (auto_bed_leveling_grid_points & 1) ? true : false; //always end at [RIGHT_PROBE_BED_POSITION, BACK_PROBE_BED_POSITION]
3640
 
3640
 
3641
       for (int yCount = 0; yCount < auto_bed_leveling_grid_points; yCount++) {
3641
       for (int yCount = 0; yCount < auto_bed_leveling_grid_points; yCount++) {
3642
-        double yProbe = front_probe_bed_position + yGridSpacing * yCount;
3642
+        float yBase = front_probe_bed_position + yGridSpacing * yCount,
3643
+              yProbe = floor(yProbe + (yProbe < 0 ? 0 : 0.5));
3643
         int xStart, xStop, xInc;
3644
         int xStart, xStop, xInc;
3644
 
3645
 
3645
         if (zig) {
3646
         if (zig) {
3656
         zig = !zig;
3657
         zig = !zig;
3657
 
3658
 
3658
         for (int xCount = xStart; xCount != xStop; xCount += xInc) {
3659
         for (int xCount = xStart; xCount != xStop; xCount += xInc) {
3659
-          double xProbe = left_probe_bed_position + xGridSpacing * xCount;
3660
+          float xBase = left_probe_bed_position + xGridSpacing * xCount,
3661
+                xProbe = floor(xProbe + (xProbe < 0 ? 0 : 0.5));
3660
 
3662
 
3661
           #if ENABLED(DELTA)
3663
           #if ENABLED(DELTA)
3662
             // Avoid probing outside the round or hexagonal area of a delta printer
3664
             // Avoid probing outside the round or hexagonal area of a delta printer

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