don't export settings object

This commit is contained in:
Simon Voordouw 2017-07-11 13:49:21 +02:00
parent d47c8ca07b
commit f87a9c0a56
6 changed files with 39 additions and 8 deletions

View File

@ -159,6 +159,7 @@ SystemJS.config({
"github:*/*.json"
],
map: {
"js-yaml": "npm:js-yaml@3.9.0",
"clipper-js": "github:Doodle3D/clipper-js@1.0.2",
"three.js": "github:mrdoob/three.js@r83",
"assert": "npm:jspm-nodelibs-assert@0.2.0",
@ -421,6 +422,17 @@ SystemJS.config({
"map": {
"Breush/clipper-lib": "github:Breush/clipper-lib@patch-1"
}
},
"npm:js-yaml@3.9.0": {
"map": {
"argparse": "npm:argparse@1.0.9",
"esprima": "npm:esprima@4.0.0"
}
},
"npm:argparse@1.0.9": {
"map": {
"sprintf-js": "npm:sprintf-js@1.0.3"
}
}
}
});

View File

@ -8,6 +8,7 @@
"dependencies": {
"Doodle3D/clipper-js": "github:Doodle3D/clipper-js@master",
"clipper-js": "github:Doodle3D/clipper-js@1.0.2",
"js-yaml": "npm:js-yaml@^3.9.0",
"json": "github:systemjs/plugin-json@^0.1.2",
"three.js": "github:mrdoob/three.js@r83",
"worker": "github:casperlamboo/plugin-worker@master"
@ -77,7 +78,9 @@
}
}
},
"dependencies": {},
"dependencies": {
"js-yaml": "^3.9.0"
},
"devDependencies": {
"jspm": "^0.17.0-beta.28"
}

View File

@ -1,4 +1,5 @@
import * as THREE from 'three.js';
import Settings from './Settings.js';
import slice from './sliceActions/slice.js';
import SlicerWorker from './slicerWorker.js!worker';
@ -28,13 +29,13 @@ export default class {
return this;
}
sliceSync(settings) {
return slice(this.geometry, settings);
return slice(this.geometry, new Settings(settings));
}
slice(settings) {
const slicerWorker = new SlicerWorker();
const geometry = this.geometry.toJSON();
const { config } = settings;
const { config } = new Settings(settings);
return new Promise((resolve, reject) => {
slicerWorker.onerror = reject;

View File

@ -1,6 +1,18 @@
import Slicer from './Slicer.js';
import Settings from './Settings.js';
import printerSettings from './settings/printer_settings.json!json';
import userSettings from './settings/user_settings.json!json';
import defaultSettings from './settings/default.yml!text';
import printerSettings from './settings/printer.yml!text';
import materialSettings from './settings/material.yml!text';
import qualitySettings from './settings/quality.yml!text';
import yaml from 'js-yaml';
export { Slicer, Settings, printerSettings, userSettings };
const ds = {
base: yaml.safeLoad(defaultSettings),
printer: yaml.safeLoad(printerSettings),
material: yaml.safeLoad(materialSettings),
quality: yaml.safeLoad(qualitySettings)
};
export {
Slicer,
ds as defaultSettings
};

View File

@ -1,6 +1,9 @@
low:
title: "Low"
layerHeight: .2
medium:
title: "Medium"
layerHeight: .15
height:
title: "High"
layerHeight: .1

View File

@ -3,7 +3,7 @@ import * as THREE from 'three.js';
export default function calculateLayersIntersections(lines, settings) {
console.log('calculating layer intersections');
const { layerHeight, dimensionsZ } = settings.config;
const { layerHeight, dimensions: { z: dimensionsZ } } = settings.config;
const numLayers = Math.floor(dimensionsZ / layerHeight);