fix z clearance moves when z top offset. fix cutout tabs when muliple parts present
This commit is contained in:
parent
8948ae477a
commit
ce93e98c35
1 changed files with 48 additions and 45 deletions
|
|
@ -903,16 +903,11 @@
|
|||
// skip if no tops | traces
|
||||
if (slice.tops.length === 0) return;
|
||||
|
||||
let trace, index, maxArea = 0, tmpArea;
|
||||
let notabs = 0;
|
||||
let nutrace = [];
|
||||
|
||||
// find trace with greatest area
|
||||
slice.tops[0].traces.forEach(function(trc, idx) {
|
||||
if ((tmpArea = trc.area()) > maxArea) {
|
||||
maxArea = tmpArea;
|
||||
index = idx;
|
||||
trace = trc;
|
||||
}
|
||||
});
|
||||
slice.tops[0].traces.forEach(function(trace, index) {
|
||||
|
||||
// required to match computed order of cutouts
|
||||
trace.setClockwise();
|
||||
|
|
@ -920,7 +915,7 @@
|
|||
let count = proc.camTabsCount,
|
||||
angle = proc.camTabsAngle,
|
||||
angle_inc = 360 / count,
|
||||
center = BASE.newPoint(0,0,slice.z),
|
||||
center = trace.circleCenter(),//BASE.newPoint(0,0,slice.z),
|
||||
offset = (tabWidth + toolDiam) / 2,
|
||||
ints = [],
|
||||
segs = [];
|
||||
|
|
@ -939,8 +934,6 @@
|
|||
ints.push(int2);
|
||||
}
|
||||
angle -= angle_inc;
|
||||
// segs.push(newPolygon([c1,o1]));
|
||||
// segs.push(newPolygon([c2,o2]));
|
||||
}
|
||||
|
||||
if (ints.length) {
|
||||
|
|
@ -949,10 +942,19 @@
|
|||
segs.push(trace.emitSegment(ints[i], ints[i+1]));
|
||||
}
|
||||
// replace intersected trace with segments
|
||||
slice.tops[0].traces.splice(index, 1, ...segs);
|
||||
nutrace.appendAll(segs);
|
||||
} else {
|
||||
console.log(`unable to compute tabs for slice @ ${slice.z}`);
|
||||
nutrace.push(trace);
|
||||
notabs++;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (notabs) {
|
||||
console.log(`unable to compute tabs for ${notabs} traces @ z=${slice.z}`, trace);
|
||||
}
|
||||
|
||||
slice.tops[0].traces = nutrace;
|
||||
}
|
||||
|
||||
// called when z-index slicing complete
|
||||
|
|
@ -1223,6 +1225,7 @@
|
|||
alignTop = settings.controller.alignTop,
|
||||
zclear = (process.camZClearance || 1) * units,
|
||||
zmax_outer = hasStock ? stock.z + zclear : outerz + zclear,
|
||||
ztoff = process.camZTopOffset,
|
||||
zadd = hasStock ? stock.z - boundsz : alignTop ? outerz - boundsz : 0,
|
||||
zmax = outerz + zclear,
|
||||
wmpos = widget.mesh.position,
|
||||
|
|
@ -1407,7 +1410,7 @@
|
|||
} //else (TODO verify no else here b/c above could change isMove)
|
||||
// move over things
|
||||
if ((deltaXY > toolDiam || (deltaZ > toolDiam && deltaXY > tolerance)) && (isMove || absDeltaZ >= tolerance)) {
|
||||
let maxz = toolProfile ? Math.max(
|
||||
let maxz = (toolProfile ? Math.max(
|
||||
getTopoZPathMax(
|
||||
widget,
|
||||
toolProfile,
|
||||
|
|
@ -1416,7 +1419,7 @@
|
|||
point.x - wmx,
|
||||
point.y - wmy) + zadd,
|
||||
point.z,
|
||||
lastPoint.z) : zmax,
|
||||
lastPoint.z) : zmax) + ztoff,
|
||||
mustGoUp = Math.max(maxz - point.z, maxz - lastPoint.z) >= tolerance,
|
||||
clearz = maxz;
|
||||
// up if any point between higher than start/outline
|
||||
|
|
|
|||
Loading…
Reference in a new issue