From 0086ae1713bd10e9024ac7bd8ca69f44daa03b75 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sat, 22 Aug 2020 17:14:27 -0400 Subject: [PATCH] extend zthru to drilling registration holes --- src/mode/cam/driver.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mode/cam/driver.js b/src/mode/cam/driver.js index 7afcdb30..f3538479 100644 --- a/src/mode/cam/driver.js +++ b/src/mode/cam/driver.js @@ -1011,7 +1011,7 @@ const camShellPolys = shellRough = shellOutline = facePolys = camShell.gatherTopPolys([]); if (procDrillReg) { - sliceDrillReg(settings, widget, sliceAll); + sliceDrillReg(settings, widget, sliceAll, zThru); } if (procDrill) { @@ -1183,12 +1183,14 @@ }); } - function sliceDrillReg(settings, widget, output) { + // drill registration holes + function sliceDrillReg(settings, widget, output, zThru) { let proc = settings.process, - bounds = settings.bounds, stock = settings.stock, + bounds = settings.bounds, mx = (bounds.max.x + bounds.min.x) / 2, my = (bounds.max.y + bounds.min.y) / 2, + mz = zThru || 0, dx = (stock.x - (bounds.max.x - bounds.min.x)) / 4, dy = (stock.y - (bounds.max.y - bounds.min.y)) / 4, dz = stock.z, @@ -1210,7 +1212,7 @@ points.forEach(point => { polys.push(newPolygon() .append(point.clone().setZ(bounds.max.z)) - .append(point.clone().setZ(bounds.max.z - stock.z))); + .append(point.clone().setZ(bounds.max.z - stock.z - mz))); }); slice.camMode = CPRO.DRILL; slice.addTop(null).traces = polys;