remove gcode int/ext macros (unused) and repurpose type system to identify features in gcode output
This commit is contained in:
parent
f15735d8c3
commit
9fd74cb27f
5 changed files with 13 additions and 25 deletions
|
|
@ -26,8 +26,6 @@
|
||||||
gcodeFan = device.gcodeFan,
|
gcodeFan = device.gcodeFan,
|
||||||
gcodeLayer = device.gcodeLayer,
|
gcodeLayer = device.gcodeLayer,
|
||||||
gcodeTrack = device.gcodeTrack,
|
gcodeTrack = device.gcodeTrack,
|
||||||
gcodeExt = device.gcodeExt,
|
|
||||||
gcodeInt = device.gcodeInt,
|
|
||||||
zMoveMax = device.deviceZMax || 0,
|
zMoveMax = device.deviceZMax || 0,
|
||||||
tool = 0,
|
tool = 0,
|
||||||
fwRetract = device.fwRetract,
|
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) {
|
if (last && out.type !== last.type) {
|
||||||
switch (out.type) {
|
append(`; feature ${out.type}`);
|
||||||
case 'ext':
|
|
||||||
appendAllSub(gcodeExt);
|
|
||||||
break;
|
|
||||||
case 'int':
|
|
||||||
appendAllSub(gcodeInt);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
lastType = out.type;
|
lastType = out.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,8 @@
|
||||||
z: firstLayerHeight / 2
|
z: firstLayerHeight / 2
|
||||||
});
|
});
|
||||||
|
|
||||||
|
print.setType('brim');
|
||||||
|
|
||||||
// output brim points
|
// output brim points
|
||||||
let brimStart = offset < nozzle * 2 ? newPoint(-bedWidth, -bedDepth, 0) : printPoint;
|
let brimStart = offset < nozzle * 2 ? newPoint(-bedWidth, -bedDepth, 0) : printPoint;
|
||||||
printPoint = print.poly2polyEmit(polys, brimStart, (poly, index, count, startPoint) => {
|
printPoint = print.poly2polyEmit(polys, brimStart, (poly, index, count, startPoint) => {
|
||||||
|
|
@ -345,6 +347,7 @@
|
||||||
let wipe = true;
|
let wipe = true;
|
||||||
lastPurgeTool = tool;
|
lastPurgeTool = tool;
|
||||||
if (rec) {
|
if (rec) {
|
||||||
|
print.setType('purge tower');
|
||||||
if (layer.last()) {
|
if (layer.last()) {
|
||||||
layer.last().retract = true;
|
layer.last().retract = true;
|
||||||
}
|
}
|
||||||
|
|
@ -513,6 +516,7 @@
|
||||||
let wtb = slice.widget.track.box;
|
let wtb = slice.widget.track.box;
|
||||||
let beltStart = slice.belt && slice.belt.touch;// && (widgets.length === 1);
|
let beltStart = slice.belt && slice.belt.touch;// && (widgets.length === 1);
|
||||||
// output seek to start point between mesh slices if previous data
|
// output seek to start point between mesh slices if previous data
|
||||||
|
print.setType('layer');
|
||||||
printPoint = print.slicePrintPath(
|
printPoint = print.slicePrintPath(
|
||||||
slice,
|
slice,
|
||||||
beltStart ? newPoint(-5000, 5000, 0) : printPoint.sub(offset),
|
beltStart ? newPoint(-5000, 5000, 0) : printPoint.sub(offset),
|
||||||
|
|
|
||||||
|
|
@ -127,8 +127,6 @@
|
||||||
gcodeLayer: valueOf(cmd.layer || code.layer, []),
|
gcodeLayer: valueOf(cmd.layer || code.layer, []),
|
||||||
gcodePre: valueOf(code.pre, []),
|
gcodePre: valueOf(code.pre, []),
|
||||||
gcodePost: valueOf(code.post, []),
|
gcodePost: valueOf(code.post, []),
|
||||||
gcodeExt: valueOf(code.ext, []),
|
|
||||||
gcodeInt: valueOf(code.int, []),
|
|
||||||
// post processor script of which only one exists
|
// post processor script of which only one exists
|
||||||
// for XYZ.daVinci.Mini.w triggered in kiri.export
|
// for XYZ.daVinci.Mini.w triggered in kiri.export
|
||||||
// in the fdm driver to turn gcode into base64
|
// in the fdm driver to turn gcode into base64
|
||||||
|
|
@ -287,8 +285,6 @@
|
||||||
maxHeight: 150,
|
maxHeight: 150,
|
||||||
gcodePre: [],
|
gcodePre: [],
|
||||||
gcodePost: [],
|
gcodePost: [],
|
||||||
gcodeExt: [],
|
|
||||||
gcodeInt: [],
|
|
||||||
gcodeProc: "",
|
gcodeProc: "",
|
||||||
gcodeFan: [],
|
gcodeFan: [],
|
||||||
gcodeTrack: [],
|
gcodeTrack: [],
|
||||||
|
|
|
||||||
|
|
@ -791,8 +791,6 @@
|
||||||
UI.deviceName,
|
UI.deviceName,
|
||||||
UI.gcodePre,
|
UI.gcodePre,
|
||||||
UI.gcodePost,
|
UI.gcodePost,
|
||||||
UI.gcodeExt,
|
|
||||||
UI.gcodeInt,
|
|
||||||
UI.bedDepth,
|
UI.bedDepth,
|
||||||
UI.bedWidth,
|
UI.bedWidth,
|
||||||
UI.maxHeight,
|
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.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.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.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.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.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,
|
(UI.gcodeChange = UC.newGCode(LANG.dv_tool_s, {title:LANG.dv_tool_l, modes:CAM, area:gcode})).button,
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
this.id = id || new Date().getTime().toString(36);
|
this.id = id || new Date().getTime().toString(36);
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.widgets = widgets;
|
this.widgets = widgets;
|
||||||
|
this.setType = setType;
|
||||||
debugE = settings ? (settings.controller.devel ? 1 : 0) : 0;
|
debugE = settings ? (settings.controller.devel ? 1 : 0) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1068,6 +1069,7 @@
|
||||||
let lastTop = null;
|
let lastTop = null;
|
||||||
outputOrderClosest(out, function(next) {
|
outputOrderClosest(out, function(next) {
|
||||||
if (next instanceof Polygon) {
|
if (next instanceof Polygon) {
|
||||||
|
setType('support');
|
||||||
// support polygon
|
// support polygon
|
||||||
next.setZ(z);
|
next.setZ(z);
|
||||||
outputTraces([next].appendAll(next.inner || []));
|
outputTraces([next].appendAll(next.inner || []));
|
||||||
|
|
@ -1076,6 +1078,7 @@
|
||||||
outputFills(next.fill, {fast: true});
|
outputFills(next.fill, {fast: true});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
setType('shells');
|
||||||
if (lastTop && lastTop !== next) {
|
if (lastTop && lastTop !== next) {
|
||||||
retract();
|
retract();
|
||||||
}
|
}
|
||||||
|
|
@ -1099,9 +1102,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// flag extrusion type as exterior
|
|
||||||
setType('ext');
|
|
||||||
|
|
||||||
// innermost shells
|
// innermost shells
|
||||||
let inner = next.innerShells() || [];
|
let inner = next.innerShells() || [];
|
||||||
|
|
||||||
|
|
@ -1113,14 +1113,15 @@
|
||||||
// output outer polygons
|
// output outer polygons
|
||||||
if (shellOrder === -1) outputTraces(inner, { sort: shellOrder });
|
if (shellOrder === -1) outputTraces(inner, { sort: shellOrder });
|
||||||
|
|
||||||
// flag extrusion type as interior
|
|
||||||
setType('int');
|
|
||||||
|
|
||||||
// output thin fill
|
// output thin fill
|
||||||
|
setType('thin fill');
|
||||||
outputThin(next.thin_fill);
|
outputThin(next.thin_fill);
|
||||||
|
|
||||||
// then output solid and sparse fill
|
// then output solid and sparse fill
|
||||||
|
setType('solid fill');
|
||||||
outputFills(next.fill_lines, {flow: solidWidth});
|
outputFills(next.fill_lines, {flow: solidWidth});
|
||||||
|
|
||||||
|
setType('sparse infill');
|
||||||
outputSparse(next.fill_sparse, sparseMult, infillSpeed);
|
outputSparse(next.fill_sparse, sparseMult, infillSpeed);
|
||||||
|
|
||||||
lastTop = next;
|
lastTop = next;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue