add flip operation for double-sided work
This commit is contained in:
parent
55fdabd906
commit
8627f54a98
8 changed files with 79 additions and 8 deletions
1
notes.md
1
notes.md
|
|
@ -5,7 +5,6 @@
|
||||||
# - revisit ease down
|
# - revisit ease down
|
||||||
# - split gcode output
|
# - split gcode output
|
||||||
# - redo path planning
|
# - redo path planning
|
||||||
# - double-sided assistance
|
|
||||||
# `fdm`
|
# `fdm`
|
||||||
# - bind process to z ranges or boxed regions
|
# - bind process to z ranges or boxed regions
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -456,6 +456,8 @@
|
||||||
camDrillDwell: 250,
|
camDrillDwell: 250,
|
||||||
camDrillLift: 2,
|
camDrillLift: 2,
|
||||||
camDrillingOn: false,
|
camDrillingOn: false,
|
||||||
|
camFlipAxis: "X",
|
||||||
|
camFlipOther: "",
|
||||||
// camDrillReg: "none",
|
// camDrillReg: "none",
|
||||||
camTabsWidth: 5,
|
camTabsWidth: 5,
|
||||||
camTabsHeight: 5,
|
camTabsHeight: 5,
|
||||||
|
|
@ -480,7 +482,8 @@
|
||||||
outputOriginCenter: false,
|
outputOriginCenter: false,
|
||||||
outputInvertX: false,
|
outputInvertX: false,
|
||||||
outputInvertY: false,
|
outputInvertY: false,
|
||||||
ops: []
|
ops: [], // current ops
|
||||||
|
op2: [] // flip ops
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
laser: {
|
laser: {
|
||||||
|
|
|
||||||
|
|
@ -1640,7 +1640,7 @@
|
||||||
******************************************************************* */
|
******************************************************************* */
|
||||||
|
|
||||||
// given a settings region, update values of matching bound UI fields
|
// given a settings region, update values of matching bound UI fields
|
||||||
function updateFieldsFromSettings(setrec, uirec = UI) {
|
function updateFieldsFromSettings(setrec, uirec = UI, trace) {
|
||||||
if (!setrec) {
|
if (!setrec) {
|
||||||
return console.trace("missing scope");
|
return console.trace("missing scope");
|
||||||
}
|
}
|
||||||
|
|
@ -1664,7 +1664,7 @@
|
||||||
} else if (typ === 'select-one') {
|
} else if (typ === 'select-one') {
|
||||||
uie.innerHTML = '';
|
uie.innerHTML = '';
|
||||||
let source = uie.parentNode.getAttribute('source'),
|
let source = uie.parentNode.getAttribute('source'),
|
||||||
list = settings[source] || lists[source],
|
list = uie._source || settings[source] || lists[source],
|
||||||
chosen = null;
|
chosen = null;
|
||||||
if (list) list.forEach(function(el, index) {
|
if (list) list.forEach(function(el, index) {
|
||||||
let id = el.id || el.name;
|
let id = el.id || el.name;
|
||||||
|
|
|
||||||
|
|
@ -733,7 +733,11 @@
|
||||||
|
|
||||||
row.appendChild(newLabel(label));
|
row.appendChild(newLabel(label));
|
||||||
row.appendChild(ip);
|
row.appendChild(ip);
|
||||||
row.setAttribute("source", source || "tools");
|
if (Array.isArray(source)) {
|
||||||
|
ip._source = source;
|
||||||
|
} else {
|
||||||
|
row.setAttribute("source", source || "tools");
|
||||||
|
}
|
||||||
row.setAttribute("class", "var-row");
|
row.setAttribute("class", "var-row");
|
||||||
row.style.display = hide ? 'none' : '';
|
row.style.display = hide ? 'none' : '';
|
||||||
if (options) {
|
if (options) {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@
|
||||||
|
|
||||||
let zaxis = { x: 0, y: 0, z: 1 },
|
let zaxis = { x: 0, y: 0, z: 1 },
|
||||||
popOp = {},
|
popOp = {},
|
||||||
func = {};
|
func = {},
|
||||||
|
flipping;
|
||||||
|
|
||||||
CAM.restoreTabs = restoreTabs;
|
CAM.restoreTabs = restoreTabs;
|
||||||
|
|
||||||
|
|
@ -156,6 +157,14 @@
|
||||||
case "register": return func.opAddRegister('X', 2);
|
case "register": return func.opAddRegister('X', 2);
|
||||||
case "drill": return func.opAddDrill();
|
case "drill": return func.opAddDrill();
|
||||||
case "trace": return func.opAddTrace();
|
case "trace": return func.opAddTrace();
|
||||||
|
case "flip":
|
||||||
|
// only one flip op permitted
|
||||||
|
for (let op of current.process.ops) {
|
||||||
|
if (op.type === 'flip') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return func.opAddFlip();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -194,6 +203,10 @@
|
||||||
func.opAdd(rec);
|
func.opAdd(rec);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
func.opAddFlip = () => {
|
||||||
|
func.opAdd(popOp.flip.new());
|
||||||
|
};
|
||||||
|
|
||||||
// TAB/TRACE BUTTON HANDLERS
|
// TAB/TRACE BUTTON HANDLERS
|
||||||
api.event.on("button.click", target => {
|
api.event.on("button.click", target => {
|
||||||
let process = API.conf.get().process;
|
let process = API.conf.get().process;
|
||||||
|
|
@ -345,6 +358,41 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
func.opFlip = () => {
|
||||||
|
let { process } = current;
|
||||||
|
let { ops, op2 } = process;
|
||||||
|
let add2 = op2.length === 0; // add flip singleton to b-side
|
||||||
|
let axis = poppedRec.axis;
|
||||||
|
flipping = true;
|
||||||
|
switch (axis) {
|
||||||
|
case 'X':
|
||||||
|
API.selection.rotate(Math.PI, 0, 0);
|
||||||
|
// API.widgets.all().forEach(widget => {
|
||||||
|
// widget.rotate(Math.PI, 0, 0);
|
||||||
|
// });
|
||||||
|
break;
|
||||||
|
case 'Y':
|
||||||
|
API.selection.rotate(0, Math.PI, 0);
|
||||||
|
// API.widgets.all().forEach(widget => {
|
||||||
|
// widget.rotate(0, Math.PI, 0);
|
||||||
|
// });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
flipping = false;
|
||||||
|
process.ops = op2;
|
||||||
|
process.op2 = ops;
|
||||||
|
for (let op of op2) {
|
||||||
|
if (op.type === 'flip') {
|
||||||
|
op.axis = poppedRec.axis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (add2) {
|
||||||
|
func.opAdd(poppedRec);
|
||||||
|
} else {
|
||||||
|
func.opRender();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// TAB FUNCS
|
// TAB FUNCS
|
||||||
let showTab, lastTab, tab, iw, ic;
|
let showTab, lastTab, tab, iw, ic;
|
||||||
api.event.on("cam.tabs.add", func.tabAdd = () => {
|
api.event.on("cam.tabs.add", func.tabAdd = () => {
|
||||||
|
|
@ -628,6 +676,9 @@
|
||||||
func.traceDone();
|
func.traceDone();
|
||||||
}
|
}
|
||||||
unselectTraces(widget);
|
unselectTraces(widget);
|
||||||
|
if (flipping) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (x || y) {
|
if (x || y) {
|
||||||
clearTabs(widget);
|
clearTabs(widget);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -817,6 +868,16 @@
|
||||||
dwell: UC.newInput(LANG.cd_dwll_s, {title:LANG.cd_dwll_l, convert:UC.toFloat}),
|
dwell: UC.newInput(LANG.cd_dwll_s, {title:LANG.cd_dwll_l, convert:UC.toFloat}),
|
||||||
lift: UC.newInput(LANG.cd_lift_s, {title:LANG.cd_lift_l, convert:UC.toFloat, units:true})
|
lift: UC.newInput(LANG.cd_lift_s, {title:LANG.cd_lift_l, convert:UC.toFloat, units:true})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
createPopOp('flip', {
|
||||||
|
axis: 'camFlipAxis'
|
||||||
|
}).inputs = {
|
||||||
|
axis: UC.newSelect(LANG.cd_axis, {}, "regaxis"),
|
||||||
|
sep: UC.newBlank({class:"pop-sep"}),
|
||||||
|
action: UC.newRow([
|
||||||
|
UC.newButton(LANG.cc_flip, func.opFlip)
|
||||||
|
], {class:"ext-buttons f-row"})
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
function createPopOp(type, map) {
|
function createPopOp(type, map) {
|
||||||
|
|
|
||||||
|
|
@ -967,7 +967,8 @@
|
||||||
"contour": OpContour,
|
"contour": OpContour,
|
||||||
"trace": OpTrace,
|
"trace": OpTrace,
|
||||||
"drill": OpDrill,
|
"drill": OpDrill,
|
||||||
"register": OpRegister
|
"register": OpRegister,
|
||||||
|
"flip": CamOp
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -422,9 +422,11 @@
|
||||||
<div title="remove an area of material inside a defined boundary sometimes called pocketing">rough</div>
|
<div title="remove an area of material inside a defined boundary sometimes called pocketing">rough</div>
|
||||||
<div title="clean up after roughing or perform a part cutout">outline</div>
|
<div title="clean up after roughing or perform a part cutout">outline</div>
|
||||||
<div title="2.5D tracing along X or Y axis used for complex part features">contour</div>
|
<div title="2.5D tracing along X or Y axis used for complex part features">contour</div>
|
||||||
<div title="drill registration holes along the X or Y axis for double-sided milling">register</div>
|
|
||||||
<div title="follow selected features with a specified tool. often used for lettering and engraving">trace</div>
|
<div title="follow selected features with a specified tool. often used for lettering and engraving">trace</div>
|
||||||
<div title="drill any holes matching selected tool diameter">drill</div>
|
<div title="drill any holes matching selected tool diameter">drill</div>
|
||||||
|
<hr width="100%">
|
||||||
|
<div title="drill registration holes along the X or Y axis for double-sided work">register</div>
|
||||||
|
<div title="flip part and load profile for other side for double-sided work">flip</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -273,6 +273,7 @@ kiri.lang['en-us'] = {
|
||||||
|
|
||||||
// CNC COMMON
|
// CNC COMMON
|
||||||
cc_menu: "limits",
|
cc_menu: "limits",
|
||||||
|
cc_flip: "flip",
|
||||||
cc_rapd_s: "xy feed",
|
cc_rapd_s: "xy feed",
|
||||||
cc_rapd_l: "max xy moves feedrate\nin workspace units / minute",
|
cc_rapd_l: "max xy moves feedrate\nin workspace units / minute",
|
||||||
cc_rzpd_s: "z feed",
|
cc_rzpd_s: "z feed",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue