remove unused rotuiens in cart grid
authorJim Morris <morris@wolfman.com>
Sat, 11 Feb 2017 18:41:24 +0000 (10:41 -0800)
committerJim Morris <morris@wolfman.com>
Sat, 11 Feb 2017 18:41:24 +0000 (10:41 -0800)
src/modules/tools/zprobe/CartGridStrategy.cpp
src/modules/tools/zprobe/CartGridStrategy.h

index 59b9ed9..e002000 100644 (file)
@@ -441,7 +441,6 @@ bool CartGridStrategy::doProbe(Gcode *gc)
         }
     }
 
-    extrapolate_unprobed_bed_level();
     print_bed_level(gc->stream);
 
     setAdjustFunction(true);
@@ -449,41 +448,6 @@ bool CartGridStrategy::doProbe(Gcode *gc)
     return true;
 }
 
-void CartGridStrategy::extrapolate_one_point(int x, int y, int xdir, int ydir)
-{
-    if (!isnan(grid[x + (grid_size * y)])) {
-        return;  // Don't overwrite good values.
-    }
-    float a = 2 * grid[(x + xdir) + (y * grid_size)] - grid[(x + xdir * 2) + (y * grid_size)]; // Left to right.
-    float b = 2 * grid[x + ((y + ydir) * grid_size)] - grid[x + ((y + ydir * 2) * grid_size)]; // Front to back.
-    float c = 2 * grid[(x + xdir) + ((y + ydir) * grid_size)] - grid[(x + xdir * 2) + ((y + ydir * 2) * grid_size)]; // Diagonal.
-    float median = c;  // Median is robust (ignores outliers).
-    if (a < b) {
-        if (b < c) median = b;
-        if (c < a) median = a;
-    } else {  // b <= a
-        if (c < b) median = b;
-        if (a < c) median = a;
-    }
-    grid[x + (grid_size * y)] = median;
-}
-
-// Fill in the unprobed points (corners of circular print surface)
-// using linear extrapolation, away from the center.
-void CartGridStrategy::extrapolate_unprobed_bed_level()
-{
-    int half = (grid_size - 1) / 2;
-    for (int y = 0; y <= half; y++) {
-        for (int x = 0; x <= half; x++) {
-            if (x + y < 3) continue;
-            extrapolate_one_point(half - x, half - y, x > 1 ? +1 : 0, y > 1 ? +1 : 0);
-            extrapolate_one_point(half + x, half - y, x > 1 ? -1 : 0, y > 1 ? +1 : 0);
-            extrapolate_one_point(half - x, half + y, x > 1 ? +1 : 0, y > 1 ? -1 : 0);
-            extrapolate_one_point(half + x, half + y, x > 1 ? -1 : 0, y > 1 ? -1 : 0);
-        }
-    }
-}
-
 void CartGridStrategy::doCompensation(float *target, bool inverse)
 {
     // Adjust print surface height by linear interpolation over the bed_level array.
index 9c6aa6f..0af60dc 100644 (file)
@@ -20,8 +20,6 @@ public:
 
 private:
 
-    void extrapolate_one_point(int x, int y, int xdir, int ydir);
-    void extrapolate_unprobed_bed_level();
     bool doProbe(Gcode *gc);
     float findBed();
     void setAdjustFunction(bool on);