add 3 point registration holes. fix animation + dwell

This commit is contained in:
Stewart Allen 2020-12-15 12:27:48 -05:00
commit 345ad8f27d
4 changed files with 25 additions and 7 deletions

View file

@ -372,6 +372,11 @@ self.kiri.loader.push(function() {
const id = toolID;
if (last) {
const lp = last.point, np = next.point;
// dwell ops have no point
if (!np) {
setTimeout(() => { renderPath(send) }, 0);
return;
}
const dx = np.x - lp.x, dy = np.y - lp.y, dz = np.z - lp.z;
// skip moves that are closer than resolution
if (Math.sqrt(dx*dx +dy*dy + dz*dz) < rez) {

View file

@ -193,7 +193,7 @@
if (procDrillReg) {
updateToolDiams(drillToolDiam);
sliceDrillReg(settings, sliceAll, zThru);
sliceDrillReg(settings, drillTool, sliceAll, zThru);
}
// identify through holes
@ -765,10 +765,11 @@
}
// drill registration holes
function sliceDrillReg(settings, output, zThru) {
function sliceDrillReg(settings, tool, output, zThru) {
let proc = settings.process,
stock = settings.stock,
bounds = settings.bounds,
r3 = tool.fluteDiameter() * 2,
mx = (bounds.max.x + bounds.min.x) / 2,
my = (bounds.max.y + bounds.min.y) / 2,
mz = zThru || 0,
@ -782,10 +783,20 @@
points.push(newPoint(bounds.min.x - dx, my, 0));
points.push(newPoint(bounds.max.x + dx, my, 0));
break;
case "x axis 3":
points.push(newPoint(bounds.min.x - dx, my, 0));
points.push(newPoint(bounds.max.x + dx, my - r3, 0));
points.push(newPoint(bounds.max.x + dx, my + r3, 0));
break;
case "y axis":
points.push(newPoint(mx, bounds.min.y - dy, 0));
points.push(newPoint(mx, bounds.max.y + dy, 0));
break;
case "y axis 3":
points.push(newPoint(mx, bounds.min.y - dy, 0));
points.push(newPoint(mx - r3, bounds.max.y + dy, 0));
points.push(newPoint(mx + r3, bounds.max.y + dy, 0));
break;
}
if (points.length) {