From b21db81f127c336f5caefa64b0deade46d4d16fd Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Sat, 23 Apr 2016 09:56:25 +0200 Subject: [PATCH] cleanup slice --- src/slice.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/slice.js b/src/slice.js index 73902bb..0e46f8b 100644 --- a/src/slice.js +++ b/src/slice.js @@ -1,11 +1,11 @@ import Shape from 'Doodle3D/clipper-js'; export default class { - constructor () { + constructor() { this.parts = []; } - optimizePaths (start) { + optimizePaths(start) { if (this.brim !== undefined && this.brim.length > 0) { this.brim = this.brim.optimizePath(start); start = this.brim.lastPoint(); @@ -14,7 +14,6 @@ export default class { var parts = []; while (this.parts.length > 0) { - var closestDistance = Infinity; var closestPart; @@ -80,10 +79,10 @@ export default class { } getOutline () { - var outLines = new Shape([], true); + const outLines = new Shape([], true); - for (var i = 0; i < this.parts.length; i ++) { - var part = this.parts[i]; + for (let i = 0; i < this.parts.length; i ++) { + const part = this.parts[i]; if (part.shape.closed) { outLines.join(this.parts[i].outerLine);