add option to select single lines instead of polylines for traces
This commit is contained in:
parent
7cf18ef9ce
commit
3a7922d1d3
5 changed files with 21 additions and 9 deletions
|
|
@ -465,6 +465,7 @@
|
||||||
camTraceDown: 0,
|
camTraceDown: 0,
|
||||||
camTraceSpeed: 250,
|
camTraceSpeed: 250,
|
||||||
camTracePlunge: 200,
|
camTracePlunge: 200,
|
||||||
|
camTraceLines: false,
|
||||||
camDrillTool: 1000,
|
camDrillTool: 1000,
|
||||||
camDrillSpindle: 1000,
|
camDrillSpindle: 1000,
|
||||||
camDrillDownSpeed: 250,
|
camDrillDownSpeed: 250,
|
||||||
|
|
|
||||||
|
|
@ -578,7 +578,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
}, poppedRec.single);
|
||||||
api.feature.hover = true;
|
api.feature.hover = true;
|
||||||
api.feature.hoverAdds = true;
|
api.feature.hoverAdds = true;
|
||||||
func.hover = func.traceHover;
|
func.hover = func.traceHover;
|
||||||
|
|
@ -867,7 +867,8 @@
|
||||||
step: 'camTraceOver',
|
step: 'camTraceOver',
|
||||||
down: 'camTraceDown',
|
down: 'camTraceDown',
|
||||||
rate: 'camTraceSpeed',
|
rate: 'camTraceSpeed',
|
||||||
plunge: 'camTracePlunge'
|
plunge: 'camTracePlunge',
|
||||||
|
single: 'camTraceLines',
|
||||||
}).inputs = {
|
}).inputs = {
|
||||||
tool: UC.newSelect(LANG.cc_tool, {}, "tools"),
|
tool: UC.newSelect(LANG.cc_tool, {}, "tools"),
|
||||||
sep: UC.newBlank({class:"pop-sep"}),
|
sep: UC.newBlank({class:"pop-sep"}),
|
||||||
|
|
@ -879,6 +880,7 @@
|
||||||
rate: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, units:true}),
|
rate: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, units:true}),
|
||||||
plunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, units:true}),
|
plunge: UC.newInput(LANG.cc_plng_s, {title:LANG.cc_plng_l, convert:UC.toInt, units:true}),
|
||||||
sep: UC.newBlank({class:"pop-sep"}),
|
sep: UC.newBlank({class:"pop-sep"}),
|
||||||
|
single: UC.newBoolean(LANG.cc_sngl_s, undefined, {title:LANG.cc_sngl_l}),
|
||||||
select: UC.newRow([
|
select: UC.newRow([
|
||||||
UC.newButton(undefined, func.traceAdd, {icon:'<i class="fas fa-plus"></i>'}),
|
UC.newButton(undefined, func.traceAdd, {icon:'<i class="fas fa-plus"></i>'}),
|
||||||
UC.newButton(undefined, func.traceDone, {icon:'<i class="fas fa-check"></i>'}),
|
UC.newButton(undefined, func.traceDone, {icon:'<i class="fas fa-check"></i>'}),
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,11 @@
|
||||||
KIRI.loader.push(function(API) {
|
KIRI.loader.push(function(API) {
|
||||||
|
|
||||||
if (KIRI.client)
|
if (KIRI.client)
|
||||||
CAM.traces = function(ondone) {
|
CAM.traces = function(ondone, single) {
|
||||||
KIRI.client.sync();
|
KIRI.client.sync();
|
||||||
let settings = API.conf.get();
|
let settings = API.conf.get();
|
||||||
let widgets = API.widgets.map();
|
let widgets = API.widgets.map();
|
||||||
KIRI.client.send("cam_traces", { settings }, output => {
|
KIRI.client.send("cam_traces", { settings, single }, output => {
|
||||||
let ids = [];
|
let ids = [];
|
||||||
KIRI.codec.decode(output).forEach(rec => {
|
KIRI.codec.decode(output).forEach(rec => {
|
||||||
ids.push(rec.id);
|
ids.push(rec.id);
|
||||||
|
|
@ -41,9 +41,9 @@
|
||||||
|
|
||||||
if (KIRI.worker)
|
if (KIRI.worker)
|
||||||
KIRI.worker.cam_traces = function(data, send) {
|
KIRI.worker.cam_traces = function(data, send) {
|
||||||
const { settings } = data;
|
const { settings, single } = data;
|
||||||
const widgets = Object.values(wcache);
|
const widgets = Object.values(wcache);
|
||||||
const fresh = widgets.filter(widget => CAM.traces(settings, widget));
|
const fresh = widgets.filter(widget => CAM.traces(settings, widget, single));
|
||||||
send.done(KIRI.codec.encode(fresh.map(widget => { return {
|
send.done(KIRI.codec.encode(fresh.map(widget => { return {
|
||||||
id: widget.id,
|
id: widget.id,
|
||||||
traces: widget.traces,
|
traces: widget.traces,
|
||||||
|
|
|
||||||
|
|
@ -221,8 +221,8 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
CAM.traces = function(settings, widget) {
|
CAM.traces = function(settings, widget, single) {
|
||||||
if (widget.traces) {
|
if (widget.traces && widget.trace_single === single) {
|
||||||
// do no work if cached
|
// do no work if cached
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -257,7 +257,13 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (single) {
|
||||||
|
poly.forEachSegment((p1, p2) => {
|
||||||
|
traces.push(newPolygon().append(p1).append(p2).setOpen());
|
||||||
|
}, poly.open);
|
||||||
|
} else {
|
||||||
traces.push(poly);
|
traces.push(poly);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
let opts = { each: oneach, over: false, flatoff: 0, edges: true, openok: true };
|
let opts = { each: oneach, over: false, flatoff: 0, edges: true, openok: true };
|
||||||
|
|
@ -265,6 +271,7 @@
|
||||||
opts.over = true;
|
opts.over = true;
|
||||||
slicer.slice(indices, opts);
|
slicer.slice(indices, opts);
|
||||||
widget.traces = traces;
|
widget.traces = traces;
|
||||||
|
widget.trace_single = single;
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -357,6 +357,8 @@ kiri.lang['en-us'] = {
|
||||||
cc_feed_l: ["max cutting speed in","workspace units / minute"],
|
cc_feed_l: ["max cutting speed in","workspace units / minute"],
|
||||||
cc_plng_s: "plunge rate",
|
cc_plng_s: "plunge rate",
|
||||||
cc_plng_l: ["max z axis speed in","workspace units / minute"],
|
cc_plng_l: ["max z axis speed in","workspace units / minute"],
|
||||||
|
cc_sngl_s: "select lines only",
|
||||||
|
cc_sngl_l: ["select only single edges","instead of connected polylines"],
|
||||||
|
|
||||||
// CNC COMMON
|
// CNC COMMON
|
||||||
cc_menu: "limits",
|
cc_menu: "limits",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue