brim now always prints the most outer layer first
This commit is contained in:
casperlamboo 2018-01-15 16:41:06 +01:00
parent 1ebbe7fc6a
commit eee2682f70
4 changed files with 15 additions and 8 deletions

View File

@ -27,10 +27,9 @@ export default function addBrim(slices, settings) {
})) }))
), new Shape([], true)).simplify('pftNonZero'); ), new Shape([], true)).simplify('pftNonZero');
firstLayer.brim = new Shape([], true); firstLayer.brim = [];
for (let offset = 0; offset < brimSize; offset += nozzleDiameter) { for (let offset = 0; offset < brimSize; offset += nozzleDiameter) {
const brimPart = brim.offset(offset, offsetOptions); const brimPart = brim.offset(offset, offsetOptions);
firstLayer.brim = firstLayer.brim.join(brimPart); firstLayer.brim.unshift(brimPart);
} }
} }

View File

@ -7,9 +7,13 @@ export default function optimizePaths(slices, settings) {
for (let layer = 0; layer < slices.length; layer ++) { for (let layer = 0; layer < slices.length; layer ++) {
const slice = slices[layer]; const slice = slices[layer];
if (typeof slice.brim !== 'undefined' && slice.brim.paths.length > 0) { if (typeof slice.brim !== 'undefined') {
slice.brim = optimizeShape(slice.brim, start); for (let i = 0; i < slice.brim.length; i ++) {
start.copy(slice.brim.lastPoint(true)); if (slice.brim[i].paths.length > 0) {
slice.brim[i] = optimizeShape(slice.brim[i], start);
start.copy(slice.brim[i].lastPoint(true));
}
}
} }
const parts = []; const parts = [];

View File

@ -25,7 +25,9 @@ export default function removePrecision(slices) {
slice.support.scaleDown(inversePrecision); slice.support.scaleDown(inversePrecision);
} }
if (typeof slice.brim !== 'undefined') { if (typeof slice.brim !== 'undefined') {
slice.brim.scaleDown(inversePrecision); for (let i = 0; i < slice.brim.length; i ++) {
slice.brim[i].scaleDown(inversePrecision);
}
} }
} }
} }

View File

@ -48,7 +48,9 @@ export default function slicesToGCode(slices, settings) {
}, {}); }, {});
if (typeof slice.brim !== 'undefined') { if (typeof slice.brim !== 'undefined') {
pathToGCode(null, false, gcode, slice.brim, true, true, z, profiles.brim); for (let i = 0; i < slice.brim.length; i ++) {
pathToGCode(null, false, gcode, slice.brim[i], false, false, z, profiles.brim);
}
} }
for (let i = 0; i < slice.parts.length; i ++) { for (let i = 0; i < slice.parts.length; i ++) {