From 604bce6a1a7d8cbb546f031f9f4e7f9cf5dce37d Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Fri, 6 May 2016 19:58:39 +0200 Subject: [PATCH] move support enabled check --- src/sliceActions/generateSupport.js | 3 +++ src/slicer.js | 10 +++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/sliceActions/generateSupport.js b/src/sliceActions/generateSupport.js index 8140e19..2970e80 100644 --- a/src/sliceActions/generateSupport.js +++ b/src/sliceActions/generateSupport.js @@ -5,6 +5,8 @@ import { PRECISION } from '../constants.js'; export default function generateSupport(slices, settings) { console.log("generating support"); + if (!settings.config.supportEnabled) return; + // need to scale up everything because of clipper rounding errors let { layerHeight, @@ -15,6 +17,7 @@ export default function generateSupport(slices, settings) { nozzleDiameter } = settings.config; + supportGridSize /= PRECISION; supportMargin /= PRECISION; plateSize /= PRECISION; diff --git a/src/slicer.js b/src/slicer.js index 74225c6..d80cc8a 100644 --- a/src/slicer.js +++ b/src/slicer.js @@ -63,8 +63,6 @@ export default class extends EventDispatcher { } slice (settings) { - const supportEnabled = settings.config['supportEnabled']; - // get unique lines from geometry; const lines = createLines(this.geometry, settings); this.progress.createdLines = true; @@ -95,11 +93,9 @@ export default class extends EventDispatcher { this.progress.generatedInfills = true; this._updateProgress(settings); - if (supportEnabled) { - generateSupport(slices, settings); - this.progress.generatedSupport = true; - this._updateProgress(settings); - } + generateSupport(slices, settings); + this.progress.generatedSupport = true; + this._updateProgress(settings); addBrim(slices, settings);