Merge branch 'master' into cam-topo4
This commit is contained in:
commit
c6d13a64b2
8 changed files with 37 additions and 8 deletions
|
|
@ -1349,6 +1349,7 @@ CAM.init = function(kiri, api) {
|
|||
rate: 'camTraceSpeed',
|
||||
plunge: 'camTracePlunge',
|
||||
bottom: 'camTraceBottom',
|
||||
offover: 'camTraceOffOver',
|
||||
select: 'camTraceMode'
|
||||
}).inputs = {
|
||||
tool: UC.newSelect(LANG.cc_tool, {}, "tools"),
|
||||
|
|
@ -1363,6 +1364,7 @@ CAM.init = function(kiri, api) {
|
|||
step: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.01,1.0), show:(op) => popOp.trace.rec.mode === "clear"}),
|
||||
down: UC.newInput(LANG.cc_sdwn_s, {title:LANG.cc_sdwn_l, convert:UC.toFloat, units:true}),
|
||||
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, show:zBottom, poop:true }),
|
||||
bottom: UC.newBoolean(LANG.cf_botm_s, undefined, {title:LANG.cf_botm_l, show:(op,conf) => conf.process.camZBottom}),
|
||||
sep: UC.newBlank({class:"pop-sep"}),
|
||||
|
|
|
|||
|
|
@ -47,14 +47,16 @@ CAM.export = function(print, online) {
|
|||
spro = settings.process,
|
||||
maxZd = spro.camFastFeedZ,
|
||||
maxXYd = spro.camFastFeed,
|
||||
decimals = base.config.gcode_decimals || 4,
|
||||
decimals = base.config.gcode_decimals || 3,
|
||||
pos = { x:null, y:null, z:null, a:undefined, f:null, t:null, emit:null },
|
||||
line,
|
||||
cidx,
|
||||
mode,
|
||||
point,
|
||||
points = 0,
|
||||
lastGn = '',
|
||||
rewrite_comments = false,
|
||||
compact_output = false,
|
||||
lasering = false,
|
||||
laserOp,
|
||||
stock = settings.stock || { },
|
||||
|
|
@ -249,7 +251,8 @@ CAM.export = function(print, online) {
|
|||
}
|
||||
|
||||
let speed = out.speed,
|
||||
nl = [speed ? 'G1' : 'G0'],
|
||||
gn = speed ? 'G1' : 'G0',
|
||||
nl = (compact_output && lastGn === gn) ? [] : [gn],
|
||||
dx = opt.dx || newpos.x - pos.x,
|
||||
dy = opt.dy || newpos.y - pos.y,
|
||||
dz = opt.dz || newpos.z - pos.z,
|
||||
|
|
@ -263,6 +266,8 @@ CAM.export = function(print, online) {
|
|||
return;
|
||||
}
|
||||
|
||||
lastGn = gn;
|
||||
|
||||
if (dx || newpos.x !== pos.x) {
|
||||
pos.x = newpos.x;
|
||||
runbox.min.x = Math.min(runbox.min.x, pos.x);
|
||||
|
|
@ -351,6 +356,12 @@ CAM.export = function(print, online) {
|
|||
}
|
||||
} else if (line.indexOf(';; REWRITE-COMMENTS-PARENS') === 0) {
|
||||
rewrite_comments = true;
|
||||
} else if (line.indexOf(';; DECMIALS') === 0) {
|
||||
decimals = parseInt(line.split('=')[1].trim() || 3) || 3;
|
||||
} else if (line.indexOf(';; COMPACT-OUTPUT') === 0) {
|
||||
compact_output = true;
|
||||
stripComments = true;
|
||||
space = '';
|
||||
} else {
|
||||
gcodePre.push(line);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -909,7 +909,7 @@ class OpTrace extends CamOp {
|
|||
|
||||
async slice(progress) {
|
||||
let { op, state } = this;
|
||||
let { tool, rate, down, plunge, offset, thru } = op;
|
||||
let { tool, rate, down, plunge, offset, offover, thru } = op;
|
||||
let { settings, widget, addSlices, zMax, zTop, zThru, tabs } = state;
|
||||
let { updateToolDiams, cutTabs, cutPolys, healPolys, color } = state;
|
||||
let { process, stock } = settings;
|
||||
|
|
@ -920,8 +920,10 @@ class OpTrace extends CamOp {
|
|||
// generate tracing offsets from chosen features
|
||||
let sliceOut = this.sliceOut = [];
|
||||
let areas = op.areas[widget.id] || [];
|
||||
let toolDiam = new CAM.Tool(settings, tool).fluteDiameter();
|
||||
let camTool = new CAM.Tool(settings, tool);
|
||||
let toolDiam = camTool.fluteDiameter();
|
||||
let toolOver = toolDiam * op.step;
|
||||
let traceOffset = camTool.traceOffset()
|
||||
let cutdir = process.camConventional;
|
||||
let polys = [];
|
||||
let stockRect = stock.center && stock.x && stock.y ?
|
||||
|
|
@ -1047,11 +1049,13 @@ class OpTrace extends CamOp {
|
|||
routed.push(poly);
|
||||
});
|
||||
for (let poly of POLY.nest(routed)) {
|
||||
let offdist = 0;
|
||||
let offdist = offover;
|
||||
if (!offdist)
|
||||
switch (offset) {
|
||||
case "outside": offdist = toolDiam / 2; break;
|
||||
case "inside": offdist = -toolDiam / 2; break;
|
||||
case "outside": offdist = traceOffset; break;
|
||||
case "inside": offdist = -traceOffset; break;
|
||||
}
|
||||
console.log({ offdist });
|
||||
if (offdist) {
|
||||
let pnew = POLY.offset([poly], offdist, { minArea: 0 });
|
||||
if (pnew) {
|
||||
|
|
@ -1072,6 +1076,9 @@ class OpTrace extends CamOp {
|
|||
followZ(pi.clone().setZ(z));
|
||||
}
|
||||
} else {
|
||||
if (thru) {
|
||||
pi.setZ(pi.getZ() - thru);
|
||||
}
|
||||
followZ(pi);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,10 @@ class Tool {
|
|||
return this.unitScale() * this.tool.taper_tip;
|
||||
}
|
||||
|
||||
traceOffset() {
|
||||
return (this.isTaperMill() ? this.tipDiameter() : this.fluteDiameter()) / 2;
|
||||
}
|
||||
|
||||
shaftLength() {
|
||||
return this.unitScale() * this.tool.shaft_len;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue