fix cam trace dup selection, add cam trace merge option, add more bambu print options
This commit is contained in:
parent
3e27f195d0
commit
2e1114510a
12 changed files with 120 additions and 58 deletions
|
|
@ -1467,6 +1467,7 @@ CAM.init = function(kiri, api) {
|
|||
offover: 'camTraceOffOver',
|
||||
dogbone: 'camTraceDogbone',
|
||||
revbone: 'camTraceDogbone',
|
||||
merge: 'camTraceMerge',
|
||||
select: 'camTraceMode'
|
||||
}).inputs = {
|
||||
tool: UC.newSelect(LANG.cc_tool, {}, "tools"),
|
||||
|
|
@ -1483,6 +1484,7 @@ CAM.init = function(kiri, api) {
|
|||
thru: UC.newInput(LANG.cc_thru_s, {title:LANG.cc_thru_l, convert:UC.toFloat, units:true}),
|
||||
offover: UC.newInput(LANG.cc_offd_s, {title:LANG.cc_offd_l, convert:UC.toFloat, units:true, show:() => poppedRec.offset !== "none"}),
|
||||
sep: UC.newBlank({class:"pop-sep", modes:MCAM, xshow:zDogSep}),
|
||||
merge: UC.newBoolean(LANG.co_merg_s, undefined, {title:LANG.co_merg_l}),
|
||||
bottom: UC.newBoolean(LANG.cf_botm_s, undefined, {title:LANG.cf_botm_l, show:(op,conf) => conf.process.camZBottom}),
|
||||
dogbone: UC.newBoolean(LANG.co_dogb_s, undefined, {title:LANG.co_dogb_l, show:canDogBones}),
|
||||
revbone: UC.newBoolean(LANG.co_dogr_s, undefined, {title:LANG.co_dogr_l, show:canDogBonesRev}),
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ kiri.load(api => {
|
|||
kiri.client.send("cam_traces", { settings, single }, output => {
|
||||
const ids = [];
|
||||
kiri.codec.decode(output).forEach(rec => {
|
||||
console.log({ rec });
|
||||
ids.push(rec.id);
|
||||
widgets[rec.id].traces = rec.traces;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1090,6 +1090,7 @@ class OpTrace extends CamOp {
|
|||
poly2polyEmit(polys, newPoint(0,0,0), (poly, index, count, spoint) => {
|
||||
routed.push(poly);
|
||||
});
|
||||
let output = [];
|
||||
for (let poly of POLY.nest(routed)) {
|
||||
let offdist = offset !== 'none' ? offover : 0;
|
||||
if (!offdist)
|
||||
|
|
@ -1116,15 +1117,24 @@ class OpTrace extends CamOp {
|
|||
zto -= zThru;
|
||||
}
|
||||
for (let z of base.util.lerp(zTop, zto, down)) {
|
||||
followZ(pi.clone().setZ(z));
|
||||
output.push(pi.clone().setZ(z));
|
||||
}
|
||||
} else {
|
||||
if (thru) {
|
||||
pi.setZ(pi.getZ() - thru);
|
||||
}
|
||||
followZ(pi);
|
||||
output.push(pi);
|
||||
}
|
||||
}
|
||||
// merge overlapping output to prevent overcuts
|
||||
if (op.merge) {
|
||||
let nest = POLY.nest(output);
|
||||
let union = POLY.union(nest, 0, true);
|
||||
output = POLY.flatten(union, [], true);
|
||||
}
|
||||
for (let poly of output) {
|
||||
followZ(poly);
|
||||
}
|
||||
break;
|
||||
case "clear":
|
||||
const zbo = widget.track.top - widget.track.box.d;
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ CAM.traces = async function(settings, widget, single) {
|
|||
let trace = traces[i];
|
||||
let dz = Math.abs(z - trace.getZ());
|
||||
// only compare polys farther apart in Z
|
||||
if (dz < 0.01) {
|
||||
if (dz > 0.01) {
|
||||
continue;
|
||||
}
|
||||
// do not add duplicates
|
||||
|
|
|
|||
Loading…
Reference in a new issue