add cam expert menu and 'skip shadow' safety disable

This commit is contained in:
Stewart Allen 2021-01-04 10:01:13 -05:00
commit 0d4e81b11a
6 changed files with 25 additions and 9 deletions

View file

@ -484,6 +484,7 @@
outputOriginCenter: false,
outputInvertX: false,
outputInvertY: false,
camExpertFast: false,
ops: [], // current ops
op2: [] // flip ops
}

View file

@ -1702,6 +1702,9 @@
outputOriginCenter: UC.newBoolean(LANG.or_cntr_s, onBooleanClick, {title:LANG.or_cntr_l, modes:CAM_LASER}),
camOriginTop: UC.newBoolean(LANG.or_topp_s, onBooleanClick, {title:LANG.or_topp_l, modes:CAM}),
camExpert: UC.newGroup(LANG.op_xprt_s, null, {group: "cam_expert", modes:CAM, marker: false}),
camExpertFast: UC.newBoolean(LANG.cx_fast_s, onBooleanClick, {title:LANG.cx_fast_l, modes:CAM}),
advanced: UC.newGroup(LANG.ad_menu, null, {modes:FDM}),
outputRetractDist: UC.newInput(LANG.ad_rdst_s, {title:LANG.ad_rdst_l, convert:UC.toFloat, modes:FDM}),
outputRetractSpeed: UC.newInput(LANG.ad_rrat_s, {title:LANG.ad_rrat_l, convert:UC.toInt, modes:FDM}),

View file

@ -104,7 +104,7 @@
slice(progress) {
let { op, state } = this;
let { settings, widget, slicer, sliceAll } = state;
let { settings, widget, slicer, sliceAll, unsafe } = state;
let { updateToolDiams, thruHoles, tabs, cutTabs } = state;
let { tshadow, shadowTop, ztOff, zBottom, zMax } = state;
@ -185,7 +185,7 @@
// console.log('indices', ...indices, {zBottom});
slicer.slice(indices, { each: (data, index, total) => {
shadow = POLY.union(shadow.slice().appendAll(data.tops), 0.01, true);
shadow = unsafe ? data.tops : POLY.union(shadow.slice().appendAll(data.tops), 0.01, true);
if (flats.indexOf(data.z) >= 0) {
// exclude flats injected to complete shadow
return;
@ -375,7 +375,7 @@
slice(progress) {
let { op, state } = this;
let { settings, widget, slicer, sliceAll, tshadow, thruHoles } = state;
let { settings, widget, slicer, sliceAll, tshadow, thruHoles, unsafe } = state;
let { updateToolDiams, zThru, zBottom, shadowTop, tabs, cutTabs } = state;
let toolDiam = this.toolDiam = new CAM.Tool(settings, op.tool).fluteDiameter();
@ -405,7 +405,7 @@
});
} else
slicer.slice(indices, { each: (data, index, total) => {
shadow = POLY.union(shadow.slice().appendAll(data.tops), 0.01, true);
shadow = unsafe ? data.tops : POLY.union(shadow.slice().appendAll(data.tops), 0.01, true);
if (flats.indexOf(data.z) >= 0) {
// exclude flats injected to complete shadow
return;
@ -925,11 +925,11 @@
slice(progress) {
let state = this.state;
let { ops, slicer, widget } = state;
let { ops, slicer, widget, unsafe } = state;
let real = ops.map(rec => rec.op).filter(op => op);
let rough = real.filter(op => op.type === 'rough').length > 0;
let outlineIn = real.filter(op => op.type === 'outline' && op.inside).length > 0;
let outlineOut = real.filter(op => op.type === 'outline' && op.outside).length > 0;
let minStepDown = real
.map(op => (op.down || 3) / 3)
@ -938,7 +938,8 @@
let tslices = [];
let tshadow = [];
let tzindex = slicer.interval(minStepDown, { fit: true, off: 0.01, down: true, flats: true });
let skipTerrain = !(rough || outlineIn) && (tzindex.length > 50 || widget.vertices.length > 1000000);
let complex = tzindex.length > 50 || widget.vertices.length > 1000000;
let skipTerrain = unsafe || (!rough && !outlineOut && complex);
if (skipTerrain) {
console.log("skipping terrain generation");

View file

@ -39,7 +39,8 @@
minToolDiam = Infinity,
maxToolDiam = -Infinity,
thruHoles,
tabs = settings.widget[widget.id].tab;
tabs = settings.widget[widget.id].tab,
unsafe = proc.camExpertFast;
if (tabs) {
// make tab polygons
@ -61,6 +62,10 @@
});
}
if (unsafe) {
console.log("disabling overhang safeties");
}
if (!proc.ops || proc.ops.length === 0) {
throw 'no processes specified';
}
@ -106,7 +111,8 @@
zBottom,
zThru,
ztOff,
zMax
zMax,
unsafe
};
let opList = [

View file

@ -1088,6 +1088,7 @@ th, tr, td, label {
}
.t-pad2 {
width: 10px;
height: 10px;
}
#devices {

View file

@ -473,6 +473,10 @@ kiri.lang['en-us'] = {
ad_pspd_s: "polish speed",
ad_pspd_l: "polishing speed\nin millimeters / minute",
// CAM EXPERT
cx_fast_s: "skip shadow",
cx_fast_l: "disable overhang detection\ncan be faster and use less\nmemory with complex models\nbut fails with overhangs\ntry enabling if slicing\nhangs during shadowing",
// FDM GCODE
ag_menu: "gcode",
ag_nozl_s: "nozzle",