mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-23 19:43:48 +01:00
cleanup slice
This commit is contained in:
parent
9e4109a3f8
commit
b21db81f12
11
src/slice.js
11
src/slice.js
@ -1,11 +1,11 @@
|
|||||||
import Shape from 'Doodle3D/clipper-js';
|
import Shape from 'Doodle3D/clipper-js';
|
||||||
|
|
||||||
export default class {
|
export default class {
|
||||||
constructor () {
|
constructor() {
|
||||||
this.parts = [];
|
this.parts = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
optimizePaths (start) {
|
optimizePaths(start) {
|
||||||
if (this.brim !== undefined && this.brim.length > 0) {
|
if (this.brim !== undefined && this.brim.length > 0) {
|
||||||
this.brim = this.brim.optimizePath(start);
|
this.brim = this.brim.optimizePath(start);
|
||||||
start = this.brim.lastPoint();
|
start = this.brim.lastPoint();
|
||||||
@ -14,7 +14,6 @@ export default class {
|
|||||||
var parts = [];
|
var parts = [];
|
||||||
|
|
||||||
while (this.parts.length > 0) {
|
while (this.parts.length > 0) {
|
||||||
|
|
||||||
var closestDistance = Infinity;
|
var closestDistance = Infinity;
|
||||||
var closestPart;
|
var closestPart;
|
||||||
|
|
||||||
@ -80,10 +79,10 @@ export default class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getOutline () {
|
getOutline () {
|
||||||
var outLines = new Shape([], true);
|
const outLines = new Shape([], true);
|
||||||
|
|
||||||
for (var i = 0; i < this.parts.length; i ++) {
|
for (let i = 0; i < this.parts.length; i ++) {
|
||||||
var part = this.parts[i];
|
const part = this.parts[i];
|
||||||
|
|
||||||
if (part.shape.closed) {
|
if (part.shape.closed) {
|
||||||
outLines.join(this.parts[i].outerLine);
|
outLines.join(this.parts[i].outerLine);
|
||||||
|
Loading…
Reference in New Issue
Block a user