output outer poly first

This commit is contained in:
Stewart Allen 2019-03-04 18:12:00 -05:00
commit adc095b853
3 changed files with 63 additions and 3 deletions

View file

@ -541,7 +541,9 @@ var gs_kiri_print = exports;
shorten: finishShell && !firstLayer ? nozzle * finishFactor : 0,
extrude: shellMult,
onfirst: function(firstPoint) {
if (startPoint.distTo2D(firstPoint) > retractDist) retract();
if (startPoint.distTo2D(firstPoint) > retractDist) {
retract();
}
}
});
}
@ -724,7 +726,24 @@ var gs_kiri_print = exports;
} else {
// top object
var bounds = POLY.flatten(next.gatherOuter([]));
outputTraces([].appendAll(next.traces).appendAll(next.innerTraces() || []), bounds);
// outputTraces([].appendAll(next.traces).appendAll(next.innerTraces() || []), bounds);
// outside in
(next.traces || []).sort(function(a,b) {
return a.perimeter() > b.perimeter() ? -1 : 1;
}).forEach(function(poly, index) {
outputTraces(poly, bounds);
});
// outputTraces([].appendAll(next.traces) || []), bounds); // outer first
// inside out
// (next.innerTraces() || []).sort(function(a,b) {
// return a.perimeter() > b.perimeter() ? 1 : -1;
// }).forEach(function(poly, index) {
// outputTraces(poly, bounds);
// });
outputTraces([].appendAll(next.innerTraces() || []), bounds); // inner last
outputFills(next.fill_lines, bounds);
outputSparse(next.fill_sparse, bounds);
lastTop = next;

View file

@ -1,7 +1,7 @@
var exports = {
COPYRIGHT:"Copyright (C) 2014-2019 Stewart Allen <sa@grid.space> - All Rights Reserved",
LICENSE:"See the license.md file included with the source distribution",
VERSION:"1.2.8"
VERSION:"1.2.9"
};
if (!module) var module = {};
module.exports = exports;

View file

@ -0,0 +1,41 @@
{
"pre":[
"M117 Heating ; announce heating",
"M107 ; turn off filament cooling fan",
"M104 S{temp} T0 ; set extruder temperature",
"M140 S{bed_temp} T0 ; set bed temperature",
"G90 ; set absolute positioning mode",
"M83 ; set relative positioning for extruder",
"G28 ; home axes",
"G1 F3000 ; set default move speed",
"G1 X-8 Y-17 Z0 ; move to XY heating point",
"M190 S{bed_temp} T0 ; wait for bed to reach target temp",
"M109 S{temp} T0 ; wait for extruder to reach target temp",
"M117 Purge ; announce purge",
"G92 E0 ; set extruder position to 0",
"G1 E50 F350 ; purge 50mm from extruder",
"G1 X0 Y0 Z0 F3000 ; move to origin / wipe",
"M117 Start Print ; announce start of print"
],
"post":[
"M117 Done ; announce done",
"M107 ; turn off filament cooling fan",
"M104 S0 T0 ; turn off extruder",
"M140 S0 T0 ; turn off bed",
"G91 ; relative movement",
"G1 Z10 F1200 ; drop bed 10mm",
"G90 ; absolute positioning",
"G28 X0 Y0 ; home XY axes",
"M84 ; disable stepper motors"
],
"cmd":{
"fan_power": "M106 S{fan_speed}",
"progress": "M117 {progress}% layer {layer} / {layers}"
},
"settings":{
"origin_center": false,
"bed_width": 300,
"bed_depth": 300,
"build_height": 300
}
}