fix roughing leave_xy

This commit is contained in:
Stewart Allen 2025-12-11 20:29:20 -05:00
commit df2014d297
2 changed files with 3 additions and 6 deletions

View file

@ -32,7 +32,7 @@ let nextMeshID = 1,
maxR;
export function init(worker) {
const { dispatch } = worker;
const { dispatch, minions } = worker;
dispatch.animate_setup2 = function (data, send) {
settings = data.settings;

View file

@ -150,8 +150,9 @@ class OpArea extends CamOp {
// progressive offset of polygons inside area clipped to the shadow
let outs = [];
let clip = [];
let firstOff = -(toolDiam / 2 + (op.leave_xy ?? 0));
POLY.subtract([ area ], shadow, clip, undefined, undefined, 0);
POLY.offset(clip, [ -toolDiam / 2, -toolOver ], {
POLY.offset(clip, [ firstOff, -toolOver ], {
count: op.steps ?? 999, outs, flat: true, z, minArea: 0
});
// if we see no offsets, re-check the mesh bottom Z then exit
@ -173,10 +174,6 @@ class OpArea extends CamOp {
for (let p of out.points)
p.z += op.leave_z;
}
// for roughing backward compatability
if (op.leave_xy) {
outs = outs.map(poly => poly.offset(-op.leave_xy)).flat();
}
// support legacy outline features
if (op.omitouter) {
outs = omitOuter(outs);