format settings deconstructing

This commit is contained in:
casperlamboo 2017-07-19 11:04:13 +02:00
parent 3b4dbc0d4a
commit fdbb1469ee
3 changed files with 12 additions and 3 deletions

View File

@ -8,7 +8,9 @@ const offsetOptions = {
}; };
export default function addBrim(slices, settings) { export default function addBrim(slices, settings) {
let { brim: { offset: brimOffset } } = settings; let {
brim: { offset: brimOffset }
} = settings;
brimOffset /= PRECISION; brimOffset /= PRECISION;
const [firstLayer] = slices; const [firstLayer] = slices;

View File

@ -1,7 +1,10 @@
import * as THREE from 'three'; import * as THREE from 'three';
export default function calculateLayersIntersections(lines, settings) { export default function calculateLayersIntersections(lines, settings) {
const { layerHeight, dimensions: { z: dimensionsZ } } = settings; const {
layerHeight,
dimensions: { z: dimensionsZ }
} = settings;
const numLayers = Math.floor(dimensionsZ / layerHeight); const numLayers = Math.floor(dimensionsZ / layerHeight);

View File

@ -9,7 +9,11 @@ const offsetOptions = {
export default function generateInnerLines(slices, settings) { export default function generateInnerLines(slices, settings) {
// need to scale up everything because of clipper rounding errors // need to scale up everything because of clipper rounding errors
let { layerHeight, nozzleDiameter, shell: { thickness: shellThickness } } = settings; let {
layerHeight,
nozzleDiameter,
shell: { thickness: shellThickness }
} = settings;
nozzleDiameter /= PRECISION; nozzleDiameter /= PRECISION;
shellThickness /= PRECISION; shellThickness /= PRECISION;
const nozzleRadius = nozzleDiameter / 2; const nozzleRadius = nozzleDiameter / 2;