improve brim. setup for raft
This commit is contained in:
parent
8a4e5a053f
commit
7a13fb209a
3 changed files with 32 additions and 14 deletions
|
|
@ -211,7 +211,7 @@ var gs_kiri_fdm = exports;
|
||||||
if (slices.length === 0) break;
|
if (slices.length === 0) break;
|
||||||
|
|
||||||
// create brim, if specificed in FDM mode (code shared by laser)
|
// create brim, if specificed in FDM mode (code shared by laser)
|
||||||
if (layer === 0 && process.outputBrimCount) {
|
if (layer === 0 && (process.outputBrimCount || process.outputRaft)) {
|
||||||
var brims = [],
|
var brims = [],
|
||||||
polys = [],
|
polys = [],
|
||||||
preout = [];
|
preout = [];
|
||||||
|
|
@ -232,15 +232,29 @@ var gs_kiri_fdm = exports;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// merge brims
|
||||||
|
brims = POLY.union(brims);
|
||||||
|
|
||||||
// if brim is offset, the expand and shrink to cause brims to merge
|
// if brim is offset, the expand and shrink to cause brims to merge
|
||||||
if (process.outputBrimOffset && brims.length) {
|
if (process.outputBrimOffset && brims.length) {
|
||||||
|
var extra = process.sliceSupportExtra + 2;
|
||||||
|
brims = POLY.expand(brims, extra, 0, null, 1);
|
||||||
|
brims = POLY.expand(brims, -extra, 0, null, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
POLY.union(brims).forEach(function(brim) {
|
// if raft is specified
|
||||||
|
if (process.outputRaft) {
|
||||||
|
console.log("output raft coming soon");
|
||||||
|
}
|
||||||
|
|
||||||
|
// if using brim vs raft
|
||||||
|
if (process.outputBrimCount) {
|
||||||
|
// expand brims
|
||||||
|
brims.forEach(function(brim) {
|
||||||
POLY.trace2count(brim, polys, -device.nozzleSize, process.outputBrimCount, 0);
|
POLY.trace2count(brim, polys, -device.nozzleSize, process.outputBrimCount, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// output brim points
|
||||||
printPoint = print.poly2polyEmit(polys, printPoint, function(poly, index, count, startPoint) {
|
printPoint = print.poly2polyEmit(polys, printPoint, function(poly, index, count, startPoint) {
|
||||||
return print.polyPrintPath(poly, startPoint, preout, {
|
return print.polyPrintPath(poly, startPoint, preout, {
|
||||||
rate: process.firstLayerRate,
|
rate: process.firstLayerRate,
|
||||||
|
|
@ -252,6 +266,7 @@ var gs_kiri_fdm = exports;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
print.addPrintPoints(preout, layerout, null);
|
print.addPrintPoints(preout, layerout, null);
|
||||||
preout.last().retract = true;
|
preout.last().retract = true;
|
||||||
|
|
|
||||||
|
|
@ -366,7 +366,7 @@ var gs_kiri_slice = exports;
|
||||||
valid.push(r1[i]);
|
valid.push(r1[i]);
|
||||||
valid.push(r1[i+1]);
|
valid.push(r1[i+1]);
|
||||||
}
|
}
|
||||||
return valid;
|
return valid.length > 2 ? valid : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
sliceVase: 1,
|
sliceVase: 1,
|
||||||
firstSliceHeight: 1,
|
firstSliceHeight: 1,
|
||||||
firstLayerRate: 1,
|
firstLayerRate: 1,
|
||||||
|
outputRaft: 1,
|
||||||
outputTemp: 1,
|
outputTemp: 1,
|
||||||
outputFanMax: 1,
|
outputFanMax: 1,
|
||||||
outputBedTemp: 1,
|
outputBedTemp: 1,
|
||||||
|
|
@ -277,6 +278,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
|
|
||||||
firstSliceHeight: 0.25,
|
firstSliceHeight: 0.25,
|
||||||
firstLayerRate: 30,
|
firstLayerRate: 30,
|
||||||
|
outputRaft: false,
|
||||||
|
|
||||||
outputTemp: 220,
|
outputTemp: 220,
|
||||||
outputFanMax: 255,
|
outputFanMax: 255,
|
||||||
|
|
@ -2399,6 +2401,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
firstLayerRate: UC.newInput("print speed", {title:"print move max speed\nmillimeters / minute", convert:UC.toFloat, modes:FDM}),
|
firstLayerRate: UC.newInput("print speed", {title:"print move max speed\nmillimeters / minute", convert:UC.toFloat, modes:FDM}),
|
||||||
outputBrimCount: UC.newInput("skirt count", {title:"number of skirts", convert:UC.toInt, modes:FDM}),
|
outputBrimCount: UC.newInput("skirt count", {title:"number of skirts", convert:UC.toInt, modes:FDM}),
|
||||||
outputBrimOffset: UC.newInput("skirt offset", {title:"millimeters", convert:UC.toFloat, modes:FDM}),
|
outputBrimOffset: UC.newInput("skirt offset", {title:"millimeters", convert:UC.toFloat, modes:FDM}),
|
||||||
|
outputRaft: UC.newBoolean("raft", onBooleanClick, {title:"create a raft under the\nmodel for better adhesion", modes:FDM}),
|
||||||
|
|
||||||
advanced: UC.newGroup("advanced", null, {modes:FDM}),
|
advanced: UC.newGroup("advanced", null, {modes:FDM}),
|
||||||
// outputRetractOver: UC.newInput("retract over", {title:"move threshold that\ntriggers retraction\n0 to disable", convert:UC.toFloat, modes:FDM}),
|
// outputRetractOver: UC.newInput("retract over", {title:"move threshold that\ntriggers retraction\n0 to disable", convert:UC.toFloat, modes:FDM}),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue