From 6e6ad316007ba705b38d87cab2016d4c1be865b9 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Tue, 15 Jul 2025 18:36:35 -0400 Subject: [PATCH] formatting --- src/kiri/mode/cam/op-contour.js | 14 +++++++------- src/kiri/mode/cam/op-drill.js | 14 +++++++------- src/kiri/mode/cam/op-lathe.js | 4 ++-- src/kiri/mode/cam/op-register.js | 10 +++++----- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/kiri/mode/cam/op-contour.js b/src/kiri/mode/cam/op-contour.js index c4860bb6..f066e99c 100644 --- a/src/kiri/mode/cam/op-contour.js +++ b/src/kiri/mode/cam/op-contour.js @@ -15,7 +15,7 @@ function createFilter(op) { let idx = 0; if (obj && obj.slices) { const nadd = []; - filter = function(slices) { + filter = function (slices) { for (let slice of slices) { if (obj.slices(slice, idx++)) { nadd.push(slice); @@ -78,7 +78,7 @@ class OpContour extends CamOp { setSpindle(op.spindle); setTolerance(this.tolerance); - printPoint = newPoint(bounds.min.x,bounds.min.y,zmax); + printPoint = newPoint(bounds.min.x, bounds.min.y, zmax); for (let slice of sliceOut) { // ignore debug slices @@ -88,17 +88,17 @@ class OpContour extends CamOp { let polys = [], poly, emit; slice.camLines.forEach(function (poly) { if (depthFirst) poly = poly.clone(true); - polys.push({first:poly.first(), last:poly.last(), poly:poly}); + polys.push({ first: poly.first(), last: poly.last(), poly: poly }); }); if (depthFirst) { depthData.appendAll(polys); } else { - printPoint = tip2tipEmit(polys, printPoint, function(el, point, count) { + printPoint = tip2tipEmit(polys, printPoint, function (el, point, count) { poly = el.poly; if (poly.last() === point) { poly.reverse(); } - poly.forEachPoint(function(point, pidx) { + poly.forEachPoint(function (point, pidx) { camOut(point.clone(), pidx > 0, stepover); }, false); }); @@ -107,12 +107,12 @@ class OpContour extends CamOp { } if (depthFirst) { - printPoint = tip2tipEmit(depthData, printPoint, function(el, point, count) { + printPoint = tip2tipEmit(depthData, printPoint, function (el, point, count) { let poly = el.poly; if (poly.last() === point) { poly.reverse(); } - poly.forEachPoint(function(point, pidx) { + poly.forEachPoint(function (point, pidx) { camOut(point.clone(), pidx > 0, stepover); }, false); newLayer(); diff --git a/src/kiri/mode/cam/op-drill.js b/src/kiri/mode/cam/op-drill.js index 80ff6521..eefde0cf 100644 --- a/src/kiri/mode/cam/op-drill.js +++ b/src/kiri/mode/cam/op-drill.js @@ -15,7 +15,7 @@ class OpDrill extends CamOp { let { op, state } = this; let { settings, addSlices, widget, updateToolDiams } = state; let { zBottom, zThru, thruHoles, color } = state; - let { drills, drillThrough} = op + let { drills, drillThrough } = op let drillTool = new Tool(settings, op.tool), drillToolDiam = drillTool.fluteDiameter(), @@ -25,8 +25,8 @@ class OpDrill extends CamOp { const allDrills = drills[widget.id] ?? [] // drill points to use center (average of all points) of the polygon - allDrills.forEach((drill)=> { - if(!drill.selected){ + allDrills.forEach((drill) => { + if (!drill.selected) { return } let slice = newSlice(0); @@ -36,10 +36,10 @@ class OpDrill extends CamOp { } drill.zBottom = drill.z - drill.depth; // for thru holes, follow z thru when set - if ((op.thru>0) ) { + if ((op.thru > 0)) { drill.zBottom -= op.thru; } - const poly = newPolygon() + const poly = newPolygon() poly.points.push(newPoint(drill.x, drill.y, drill.z)) poly.points.push(newPoint(drill.x, drill.y, drill.zBottom)) // poly.points.pop(); @@ -47,7 +47,7 @@ class OpDrill extends CamOp { slice.camLines = [poly]; slice.output() - .setLayer("drill", {face: color, line: color}) + .setLayer("drill", { face: color, line: color }) .addPolys(slice.camLines); addSlices(slice); sliceOut.push(slice); @@ -59,7 +59,7 @@ class OpDrill extends CamOp { let { settings, widget, addSlices, updateToolDiams } = state; let { setTool, setSpindle, setDrill, emitDrills } = ops; setTool(op.tool, undefined, op.rate); - setDrill(op.down, op.lift, op.dwell,op.thru); + setDrill(op.down, op.lift, op.dwell, op.thru); setSpindle(op.spindle); emitDrills(this.sliceOut.map(slice => slice.camLines).flat()); } diff --git a/src/kiri/mode/cam/op-lathe.js b/src/kiri/mode/cam/op-lathe.js index 275b6906..915ae7e1 100644 --- a/src/kiri/mode/cam/op-lathe.js +++ b/src/kiri/mode/cam/op-lathe.js @@ -13,7 +13,7 @@ function createFilter(op) { let idx = 0; if (obj && obj.slices) { const nadd = []; - filter = function(slices) { + filter = function (slices) { for (let slice of slices) { if (obj.slices(slice, idx++)) { nadd.push(slice); @@ -110,7 +110,7 @@ class OpLathe extends CamOp { // camOut(last = last.clone().setZ(zmax), 0); // camOut(last = last.clone().setA(amax), 0); newLayer(); - ops.addGCode([`G0 Z${zmax.round(2)}`,`G0 A${amax}`,"G92 A0"]); + ops.addGCode([`G0 Z${zmax.round(2)}`, `G0 A${amax}`, "G92 A0"]); setPrintPoint(last); } diff --git a/src/kiri/mode/cam/op-register.js b/src/kiri/mode/cam/op-register.js index 54a359e9..a4533868 100644 --- a/src/kiri/mode/cam/op-register.js +++ b/src/kiri/mode/cam/op-register.js @@ -78,7 +78,7 @@ class OpRegister extends CamOp { poly, cp, cz; function start(z) { cz = z; - cp = {x:x0 + o2 * 0.5, y:y0 + o2 * 1.5}; + cp = { x: x0 + o2 * 0.5, y: y0 + o2 * 1.5 }; poly = newPolygon().add(cp.x, cp.y, z); } function move(dx, dy) { @@ -115,16 +115,16 @@ class OpRegister extends CamOp { }); poly.points.pop(); slice.camTrace = { tool: tool.getID(), rate: op.feed, plunge: op.rate }; - slice.camLines = [ poly ]; + slice.camLines = [poly]; slice.output() - .setLayer("register", {line: color}, false) + .setLayer("register", { line: color }, false) .addPolys(slice.camLines) } break; } if (points.length) { - let slice = newSlice(0,null), polys = []; + let slice = newSlice(0, null), polys = []; points.forEach(point => { polys.push(newPolygon() .append(point.clone().setZ(z1)) @@ -132,7 +132,7 @@ class OpRegister extends CamOp { }); slice.camLines = polys; slice.output() - .setLayer("register", {face: color, line: color}) + .setLayer("register", { face: color, line: color }) .addPolys(polys); addSlices(slice); sliceOut.push(slice);