mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2025-04-03 10:23:23 +02:00
16 lines
409 B
JavaScript
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));
|
|
}
|
|
}
|