use deconstructs

This commit is contained in:
casperlamboo 2016-03-29 08:49:35 +02:00
parent e573a0662b
commit aa9de5ec47
4 changed files with 34 additions and 22 deletions

View File

@ -3,8 +3,7 @@ import THREE from 'three.js';
export default function calculateLayersIntersections(lines, settings) {
console.log('calculating layer intersections');
var layerHeight = settings.config["layerHeight"];
var height = settings.config["dimensionsZ"];
const { layerHeight, dimensionsZ: height } = settings.config;
var numLayers = Math.floor(height / layerHeight);

View File

@ -1,18 +1,25 @@
import getFillTemplate from './getFillTemplate.js';
import Paths from '../paths.js';
const scale = 100;
export default function generateInfills(slices, settings) {
console.log("generating infills");
// need to scale up everything because of clipper rounding errors
var scale = 100;
var layerHeight = settings.config["layerHeight"];
var fillGridSize = settings.config["fillGridSize"] * scale;
var bottomThickness = settings.config["bottomThickness"];
var topThickness = settings.config["topThickness"];
var nozzleDiameter = settings.config["nozzleDiameter"] * scale;
var infillOverlap = settings.config["infillOverlap"] * scale;
let {
layerHeight,
fillGridSize,
bottomThickness,
topThickness,
nozzleDiameter,
infillOverlap
} = settings.config;
fillGridSize *= scale;
nozzleDiameter *= scale;
infillOverlap *= scale;
var bottomSkinCount = Math.ceil(bottomThickness/layerHeight);
var topSkinCount = Math.ceil(topThickness/layerHeight);

View File

@ -1,12 +1,12 @@
const scale = 100;
export default function generateInnerLines(slices, settings) {
console.log("generating outer lines and inner lines");
// need to scale up everything because of clipper rounding errors
var scale = 100;
var layerHeight = settings.config["layerHeight"];
var nozzleDiameter = settings.config["nozzleDiameter"] * scale;
var shellThickness = settings.config["shellThickness"] * scale;
let {layerHeight, nozzleDiameter, shellThickness} = settings.config;
nozzleDiameter *= scale;
shellThickness *= scale;
var nozzleRadius = nozzleDiameter / 2;
var shells = Math.round(shellThickness / nozzleDiameter);

View File

@ -1,20 +1,26 @@
import getFillTemplate from './getFillTemplate.js';
import Paths from '../paths.js';
const scale = 100;
export default function generateSupport(slices, settings) {
console.log("generating support");
// need to scale up everything because of clipper rounding errors
var scale = 100;
let {
layerHeight,
supportGridSize,
supportAcceptanceMargin,
supportPlateSize: plateSize,
supportDistanceY,
nozzleDiameter
} = settings.config;
var layerHeight = settings.config["layerHeight"];
var supportGridSize = settings.config["supportGridSize"] * scale;
var supportAcceptanceMargin = settings.config["supportAcceptanceMargin"] * scale;
var supportMargin = settings.config["supportMargin"] * scale;
var plateSize = settings.config["supportPlateSize"] * scale;
var supportDistanceY = settings.config["supportDistanceY"];
supportGridSize *= scale;
supportMargin *= scale;
plateSize *= scale;
nozzleDiameter *= scale;
var supportDistanceLayers = Math.max(Math.ceil(supportDistanceY / layerHeight), 1);
var nozzleDiameter = settings.config["nozzleDiameter"] * scale;
var supportAreas = new Paths([], true);