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) {
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;

View File

@ -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);