Revert "Fix brim"

This reverts commit eee2682f70.
This commit is contained in:
casperlamboo 2018-01-17 23:53:49 +01:00
parent 082329b810
commit 0f7da85453
4 changed files with 8 additions and 15 deletions

View File

@ -27,9 +27,10 @@ export default function addBrim(slices, settings) {
})) }))
), new Shape([], true)).simplify('pftNonZero'); ), new Shape([], true)).simplify('pftNonZero');
firstLayer.brim = []; firstLayer.brim = new Shape([], true);
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.unshift(brimPart); firstLayer.brim = firstLayer.brim.join(brimPart);
} }
} }

View File

@ -7,13 +7,9 @@ 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') { if (typeof slice.brim !== 'undefined' && slice.brim.paths.length > 0) {
for (let i = 0; i < slice.brim.length; i ++) { slice.brim = optimizeShape(slice.brim, start);
if (slice.brim[i].paths.length > 0) { start.copy(slice.brim.lastPoint(true));
slice.brim[i] = optimizeShape(slice.brim[i], start);
start.copy(slice.brim[i].lastPoint(true));
}
}
} }
const parts = []; const parts = [];

View File

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

View File

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