fix most vertical out on curves only
This commit is contained in:
parent
2370702464
commit
c231218cc3
1 changed files with 13 additions and 0 deletions
|
|
@ -9,8 +9,10 @@
|
||||||
CAM = KIRI.driver.CAM,
|
CAM = KIRI.driver.CAM,
|
||||||
PRO = CAM.process,
|
PRO = CAM.process,
|
||||||
POLY = BASE.polygons,
|
POLY = BASE.polygons,
|
||||||
|
RAD2DEG = 180 / Math.PI,
|
||||||
newSlice = KIRI.newSlice,
|
newSlice = KIRI.newSlice,
|
||||||
newLine = BASE.newLine,
|
newLine = BASE.newLine,
|
||||||
|
newSlope = BASE.newSlope,
|
||||||
newPoint = BASE.newPoint,
|
newPoint = BASE.newPoint,
|
||||||
newPolygon = BASE.newPolygon,
|
newPolygon = BASE.newPolygon,
|
||||||
noop = function() {};
|
noop = function() {};
|
||||||
|
|
@ -145,6 +147,17 @@
|
||||||
newtrace.push(latent);
|
newtrace.push(latent);
|
||||||
latent = null;
|
latent = null;
|
||||||
}
|
}
|
||||||
|
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;
|
||||||
|
// if (lastP.z < 0.1) console.log('pp', {dz, dxy, angle});
|
||||||
|
if (angle > maxangle) {
|
||||||
|
lastP = newP;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
newtrace.push(newP);
|
newtrace.push(newP);
|
||||||
}
|
}
|
||||||
lastP = newP;
|
lastP = newP;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue