mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-23 19:43:48 +01:00
simplify getOutline function
This commit is contained in:
parent
0c1c47c0c1
commit
e1336581dc
15
src/Slice.js
15
src/Slice.js
@ -5,17 +5,10 @@ export default class {
|
|||||||
this.parts = [];
|
this.parts = [];
|
||||||
}
|
}
|
||||||
getOutline() {
|
getOutline() {
|
||||||
const outLines = new Shape([], true);
|
return this.parts.reduce((shape, part) => {
|
||||||
|
if (part.outerLine) shape.join(part.outerLine);
|
||||||
for (let i = 0; i < this.parts.length; i ++) {
|
return shape;
|
||||||
const part = this.parts[i];
|
}, new Shape([], true));
|
||||||
|
|
||||||
if (part.shape.closed) {
|
|
||||||
outLines.join(this.parts[i].outerLine);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return outLines;
|
|
||||||
}
|
}
|
||||||
add(shape) {
|
add(shape) {
|
||||||
const part = { shape };
|
const part = { shape };
|
||||||
|
Loading…
Reference in New Issue
Block a user