From bfb273d72720657fab983dabb40fe05356413220 Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Tue, 16 Jun 2015 12:37:51 +0200 Subject: [PATCH] slicer didn't fill top anymore; fixed --- doodle_app/index.html | 48 +++++++++++++++++++++++++++++++++++++++++++ src/slicer.js | 7 ++++++- src/utils.js | 1 + 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 doodle_app/index.html diff --git a/doodle_app/index.html b/doodle_app/index.html new file mode 100644 index 0000000..2551d34 --- /dev/null +++ b/doodle_app/index.html @@ -0,0 +1,48 @@ + + + +Doodle 3D App + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/slicer.js b/src/slicer.js index 00bbe10..395435f 100644 --- a/src/slicer.js +++ b/src/slicer.js @@ -358,10 +358,15 @@ D3D.Slicer.prototype.generateInfills = function (slices, printer) { for (var layer = 0; layer < slices.length; layer ++) { var slice = slices[layer]; + console.log(layer + topSkinCount < slices.length); + if (layer - bottomSkinCount >= 0 && layer + topSkinCount < slices.length) { var downSkin = slices[layer - bottomSkinCount].getOutline(); var upSkin = slices[layer + topSkinCount].getOutline(); var surroundingLayer = upSkin.intersect(downSkin); + } + else { + var surroundingLayer = false; } for (var i = 0; i < slice.parts.length; i ++) { @@ -372,7 +377,7 @@ D3D.Slicer.prototype.generateInfills = function (slices, printer) { var inset = ((part.innerLines.length > 0) ? part.innerLines[part.innerLines.length - 1] : outerLine); var fillArea = inset.offset(-nozzleRadius); - if (surroundingLayer !== undefined) { + if (surroundingLayer) { var highFillArea = fillArea.difference(surroundingLayer).offset(infillOverlap).intersect(fillArea); } else { diff --git a/src/utils.js b/src/utils.js index 90ca9a7..9b1b73a 100644 --- a/src/utils.js +++ b/src/utils.js @@ -57,6 +57,7 @@ function getAPI (url, callback) { }); } +//button doesnt work in firefox!!! function downloadFile (file, data) { 'use strict';