Merge pull request #389 from GridSpace/cut-direction-bugfix

Cut direction bugfix
This commit is contained in:
Josiah Hamm 2025-06-24 21:44:51 -06:00 • committed by GitHub
commit c6c5a8cd9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 5 deletions

View file

@ -698,10 +698,6 @@ class OpOutline extends CamOp {
setTool(op.tool, op.rate, op.plunge);
setSpindle(op.spindle);
if (!process.camOutlinePocket) {
cutdir = !cutdir;
}
// printpoint becomes NaN in engine mode. not sure why but this fixes it
if(Object.values(printPoint).some(v=>Number.isNaN(v))){
printPoint = newPoint(0,0,0);

View file

@ -547,6 +547,7 @@ function prepEach(widget, settings, print, firstPoint, update) {
if (depthFirst) {
depthData.push(polys);
} else {
// if not depth first, output the polys in slice order
printPoint = poly2polyEmit(polys, printPoint, function(poly, index, count) {
poly.forEachPoint(function(point, pidx, points, offset) {
// scale speed of first cutting poly since it engages the full bit
@ -564,10 +565,12 @@ function prepEach(widget, settings, print, firstPoint, update) {
}
if (depthFirst) {
// get inside vals (the positive ones)
let ins = depthData.map(a => a.filter(p => !isNeg(p.depth)));
let itops = ins.map(level => {
return POLY.nest(level.filter(poly => poly.depth === 0).clone());
});
// get outside vals (the negative ones)
let outs = depthData.map(a => a.filter(p => isNeg(p.depth)));
let otops = outs.map(level => {
return POLY.nest(level.filter(poly => poly.depth === 0).clone());

View file

@ -215,7 +215,6 @@ const renamed = {
drillDwell: "camDrillDwell",
drillLift: "camDrillLift",
drillingOn: "camDrillingOn",
camPocketOnlyFinish: "camOutlinePocket",
camWideCutout: "camOutlineWide",
outputClockwise: "camConventional"
};