mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-23 03:23:48 +01:00
don't export settings object
This commit is contained in:
parent
d47c8ca07b
commit
f87a9c0a56
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -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"
|
||||
}
|
||||
|
@ -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;
|
||||
|
20
src/index.js
20
src/index.js
@ -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
|
||||
};
|
||||
|
@ -1,6 +1,9 @@
|
||||
low:
|
||||
title: "Low"
|
||||
layerHeight: .2
|
||||
medium:
|
||||
title: "Medium"
|
||||
layerHeight: .15
|
||||
height:
|
||||
title: "High"
|
||||
layerHeight: .1
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user