remove gcode int/ext macros (unused) and repurpose type system to identify features in gcode output

This commit is contained in:
Stewart Allen 2022-01-31 09:33:10 -05:00
commit 9fd74cb27f
5 changed files with 13 additions and 25 deletions

View file

@ -26,8 +26,6 @@
gcodeFan = device.gcodeFan,
gcodeLayer = device.gcodeLayer,
gcodeTrack = device.gcodeTrack,
gcodeExt = device.gcodeExt,
gcodeInt = device.gcodeInt,
zMoveMax = device.deviceZMax || 0,
tool = 0,
fwRetract = device.fwRetract,
@ -576,16 +574,9 @@
}
}
// emit gcode macro for changed print region
// emit comment on output type chage
if (last && out.type !== last.type) {
switch (out.type) {
case 'ext':
appendAllSub(gcodeExt);
break;
case 'int':
appendAllSub(gcodeInt);
break;
}
append(`; feature ${out.type}`);
lastType = out.type;
}

View file

@ -164,6 +164,8 @@
z: firstLayerHeight / 2
});
print.setType('brim');
// output brim points
let brimStart = offset < nozzle * 2 ? newPoint(-bedWidth, -bedDepth, 0) : printPoint;
printPoint = print.poly2polyEmit(polys, brimStart, (poly, index, count, startPoint) => {
@ -345,6 +347,7 @@
let wipe = true;
lastPurgeTool = tool;
if (rec) {
print.setType('purge tower');
if (layer.last()) {
layer.last().retract = true;
}
@ -513,6 +516,7 @@
let wtb = slice.widget.track.box;
let beltStart = slice.belt && slice.belt.touch;// && (widgets.length === 1);
// output seek to start point between mesh slices if previous data
print.setType('layer');
printPoint = print.slicePrintPath(
slice,
beltStart ? newPoint(-5000, 5000, 0) : printPoint.sub(offset),

View file

@ -127,8 +127,6 @@
gcodeLayer: valueOf(cmd.layer || code.layer, []),
gcodePre: valueOf(code.pre, []),
gcodePost: valueOf(code.post, []),
gcodeExt: valueOf(code.ext, []),
gcodeInt: valueOf(code.int, []),
// post processor script of which only one exists
// for XYZ.daVinci.Mini.w triggered in kiri.export
// in the fdm driver to turn gcode into base64
@ -287,8 +285,6 @@
maxHeight: 150,
gcodePre: [],
gcodePost: [],
gcodeExt: [],
gcodeInt: [],
gcodeProc: "",
gcodeFan: [],
gcodeTrack: [],

View file

@ -791,8 +791,6 @@
UI.deviceName,
UI.gcodePre,
UI.gcodePost,
UI.gcodeExt,
UI.gcodeInt,
UI.bedDepth,
UI.bedWidth,
UI.maxHeight,
@ -1685,8 +1683,6 @@
(UI.gcodeLayer = UC.newGCode(LANG.dv_layr_s, {title:LANG.dv_layr_l, modes:FDM, area:gcode})).button,
(UI.gcodeTrack = UC.newGCode(LANG.dv_prog_s, {title:LANG.dv_prog_l, modes:FDM, area:gcode})).button,
(UI.gcodeFan = UC.newGCode(LANG.dv_fanp_s, {title:LANG.dv_fanp_l, modes:FDM, area:gcode})).button,
(UI.gcodeExt = UC.newGCode(LANG.dv_pext_s, {title:LANG.dv_pext_l, modes:FDM, area:gcode, show:isDanger})).button,
(UI.gcodeInt = UC.newGCode(LANG.dv_pint_s, {title:LANG.dv_pint_l, modes:FDM, area:gcode, show:isDanger})).button,
(UI.gcodeLaserOn = UC.newGCode(LANG.dv_lzon_s, {title:LANG.dv_lzon_l, modes:LASER, area:gcode})).button,
(UI.gcodeLaserOff = UC.newGCode(LANG.dv_lzof_s, {title:LANG.dv_lzof_l, modes:LASER, area:gcode})).button,
(UI.gcodeChange = UC.newGCode(LANG.dv_tool_s, {title:LANG.dv_tool_l, modes:CAM, area:gcode})).button,

View file

@ -48,6 +48,7 @@
this.id = id || new Date().getTime().toString(36);
this.settings = settings;
this.widgets = widgets;
this.setType = setType;
debugE = settings ? (settings.controller.devel ? 1 : 0) : 0;
}
@ -1068,6 +1069,7 @@
let lastTop = null;
outputOrderClosest(out, function(next) {
if (next instanceof Polygon) {
setType('support');
// support polygon
next.setZ(z);
outputTraces([next].appendAll(next.inner || []));
@ -1076,6 +1078,7 @@
outputFills(next.fill, {fast: true});
}
} else {
setType('shells');
if (lastTop && lastTop !== next) {
retract();
}
@ -1099,9 +1102,6 @@
}
}
// flag extrusion type as exterior
setType('ext');
// innermost shells
let inner = next.innerShells() || [];
@ -1113,14 +1113,15 @@
// output outer polygons
if (shellOrder === -1) outputTraces(inner, { sort: shellOrder });
// flag extrusion type as interior
setType('int');
// output thin fill
setType('thin fill');
outputThin(next.thin_fill);
// then output solid and sparse fill
setType('solid fill');
outputFills(next.fill_lines, {flow: solidWidth});
setType('sparse infill');
outputSparse(next.fill_sparse, sparseMult, infillSpeed);
lastTop = next;