From 8643dacdd7e5e73361a9d8258531320e27d0a0fb Mon Sep 17 00:00:00 2001 From: Jim Morris Date: Sat, 11 Feb 2017 10:41:24 -0800 Subject: [PATCH] remove unused rotuiens in cart grid --- src/modules/tools/zprobe/CartGridStrategy.cpp | 36 ------------------- src/modules/tools/zprobe/CartGridStrategy.h | 2 -- 2 files changed, 38 deletions(-) diff --git a/src/modules/tools/zprobe/CartGridStrategy.cpp b/src/modules/tools/zprobe/CartGridStrategy.cpp index 59b9ed90..e0020000 100644 --- a/src/modules/tools/zprobe/CartGridStrategy.cpp +++ b/src/modules/tools/zprobe/CartGridStrategy.cpp @@ -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. diff --git a/src/modules/tools/zprobe/CartGridStrategy.h b/src/modules/tools/zprobe/CartGridStrategy.h index 9c6aa6fc..0af60dce 100644 --- a/src/modules/tools/zprobe/CartGridStrategy.h +++ b/src/modules/tools/zprobe/CartGridStrategy.h @@ -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); -- 2.20.1