From 7ae57e0bdac6b9ba3ec6996d909ef5a7e15f683c Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Fri, 16 Oct 2015 14:28:10 +0200 Subject: [PATCH] added detection for inside-out models --- src/slicer.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/slicer.js b/src/slicer.js index 356c40f..e0d0dec 100644 --- a/src/slicer.js +++ b/src/slicer.js @@ -342,6 +342,21 @@ export default class { return a.boundSize() - b.boundSize(); }); + console.log('test'); + + if (holes.length > outlines.length) { + [holes, outlines] = [outlines, holes]; + } + else if (holes.length === outlines.length) { + holes.sort((a, b) => { + return a.boundSize() - b.boundSize(); + }); + + if (holes[0].boundSize > outlines[0].boundSize()) { + [holes, outlines] = [outlines, holes]; + } + } + for (var i = 0; i < holes.length; i ++) { var hole = holes[i];