From d3ed5941301181c84a966d4f0591cfd6f08e0069 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Thu, 4 Mar 2021 17:10:39 -0500 Subject: [PATCH] properly select dx or dy based on contour type --- src/mode/cam/topo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mode/cam/topo.js b/src/mode/cam/topo.js index e94be23c..0b6434bb 100644 --- a/src/mode/cam/topo.js +++ b/src/mode/cam/topo.js @@ -154,8 +154,8 @@ if (curvesOnly && lastP) { // maxangle const dz = Math.abs(lastP.z - z); - const dxy = Math.max(Math.abs(lastP.x - x), Math.abs(lastP.y - y)); - const angle = Math.atan2(dz, dxy) * RAD2DEG; + const dv = contourX ? Math.abs(lastP.x - x) : Math.abs(lastP.y - y); + const angle = Math.atan2(dz, dv) * RAD2DEG; // if (lastP.z < 0.1) console.log('pp', {dz, dxy, angle}); if (angle > maxangle) { lastP = newP;