Doodle3D-Slicer/src/sliceActions/generateOutlines.js
2017-07-28 12:13:53 +02:00

16 lines
409 B
JavaScript

import Shape from 'clipper-js';
export default function calculateOutlines(slices, settings) {
for (let layer = 0; layer < slices.length; layer ++) {
const slice = slices[layer];
slice.outline = slice.parts.reduce((shape, part) => {
if (part.shape.closed) {
const [outerLine] = part.shell;
shape.join(outerLine);
}
return shape;
}, new Shape([], true));
}
}