fix rough top using wrong shadow and master shadow missing some thin flats

This commit is contained in:
Stewart Allen 2020-11-21 18:54:07 -05:00
commit b8184994d3
3 changed files with 10 additions and 2 deletions

View file

@ -399,6 +399,13 @@
array.push(opt.down ? zmax : zmin);
}
if (opt.flats && opt.off) {
// add over and under all flats by 'off'
array.appendAll(Object.keys(this.zFlat).map(v => parseFloat(v))).sort((a,b) => {
return opt.down ? b-a : a-b;
});
}
return array.map(v => parseFloat(v.toFixed(2)));
}
}

View file

@ -121,7 +121,7 @@
});
let tslices = [];
let tshadow = [];
let tzindex = slicer.interval(minStepDown, { fit: true, off: 0.01, down: true });
let tzindex = slicer.interval(minStepDown, { fit: true, off: 0.01, down: true, flats: true });
let terrain = slicer.slice(tzindex, { each: (data, index, total) => {
tshadow = POLY.union(tshadow.appendAll(data.tops), 0.01, true);
tslices.push(data.slice);
@ -146,7 +146,7 @@
// create facing slices
if (procFacing || proc.camRoughTop) {
let shadow = shadowTop.tops.clone();
let shadow = tshadow.clone();
let inset = POLY.offset(shadow, (roughToolDiam / (procRoughIn ? 2 : 1)));
let facing = POLY.offset(inset, -(roughToolDiam * proc.camRoughOver), { count: 999, flat: true });
let zdiv = ztOff / roughDown;