move support enabled check

This commit is contained in:
casperlamboo 2016-05-06 19:58:39 +02:00 committed by Simon Voordouw
parent f3796f80e8
commit 604bce6a1a
2 changed files with 6 additions and 7 deletions

View File

@ -5,6 +5,8 @@ import { PRECISION } from '../constants.js';
export default function generateSupport(slices, settings) { export default function generateSupport(slices, settings) {
console.log("generating support"); console.log("generating support");
if (!settings.config.supportEnabled) return;
// need to scale up everything because of clipper rounding errors // need to scale up everything because of clipper rounding errors
let { let {
layerHeight, layerHeight,
@ -15,6 +17,7 @@ export default function generateSupport(slices, settings) {
nozzleDiameter nozzleDiameter
} = settings.config; } = settings.config;
supportGridSize /= PRECISION; supportGridSize /= PRECISION;
supportMargin /= PRECISION; supportMargin /= PRECISION;
plateSize /= PRECISION; plateSize /= PRECISION;

View File

@ -63,8 +63,6 @@ export default class extends EventDispatcher {
} }
slice (settings) { slice (settings) {
const supportEnabled = settings.config['supportEnabled'];
// get unique lines from geometry; // get unique lines from geometry;
const lines = createLines(this.geometry, settings); const lines = createLines(this.geometry, settings);
this.progress.createdLines = true; this.progress.createdLines = true;
@ -95,11 +93,9 @@ export default class extends EventDispatcher {
this.progress.generatedInfills = true; this.progress.generatedInfills = true;
this._updateProgress(settings); this._updateProgress(settings);
if (supportEnabled) { generateSupport(slices, settings);
generateSupport(slices, settings); this.progress.generatedSupport = true;
this.progress.generatedSupport = true; this._updateProgress(settings);
this._updateProgress(settings);
}
addBrim(slices, settings); addBrim(slices, settings);