mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2025-01-11 03:45:08 +01:00
don't export settings object
This commit is contained in:
parent
d47c8ca07b
commit
f87a9c0a56
@ -159,6 +159,7 @@ SystemJS.config({
|
|||||||
"github:*/*.json"
|
"github:*/*.json"
|
||||||
],
|
],
|
||||||
map: {
|
map: {
|
||||||
|
"js-yaml": "npm:js-yaml@3.9.0",
|
||||||
"clipper-js": "github:Doodle3D/clipper-js@1.0.2",
|
"clipper-js": "github:Doodle3D/clipper-js@1.0.2",
|
||||||
"three.js": "github:mrdoob/three.js@r83",
|
"three.js": "github:mrdoob/three.js@r83",
|
||||||
"assert": "npm:jspm-nodelibs-assert@0.2.0",
|
"assert": "npm:jspm-nodelibs-assert@0.2.0",
|
||||||
@ -421,6 +422,17 @@ SystemJS.config({
|
|||||||
"map": {
|
"map": {
|
||||||
"Breush/clipper-lib": "github:Breush/clipper-lib@patch-1"
|
"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": {
|
"dependencies": {
|
||||||
"Doodle3D/clipper-js": "github:Doodle3D/clipper-js@master",
|
"Doodle3D/clipper-js": "github:Doodle3D/clipper-js@master",
|
||||||
"clipper-js": "github:Doodle3D/clipper-js@1.0.2",
|
"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",
|
"json": "github:systemjs/plugin-json@^0.1.2",
|
||||||
"three.js": "github:mrdoob/three.js@r83",
|
"three.js": "github:mrdoob/three.js@r83",
|
||||||
"worker": "github:casperlamboo/plugin-worker@master"
|
"worker": "github:casperlamboo/plugin-worker@master"
|
||||||
@ -77,7 +78,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {
|
||||||
|
"js-yaml": "^3.9.0"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jspm": "^0.17.0-beta.28"
|
"jspm": "^0.17.0-beta.28"
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import * as THREE from 'three.js';
|
import * as THREE from 'three.js';
|
||||||
|
import Settings from './Settings.js';
|
||||||
import slice from './sliceActions/slice.js';
|
import slice from './sliceActions/slice.js';
|
||||||
import SlicerWorker from './slicerWorker.js!worker';
|
import SlicerWorker from './slicerWorker.js!worker';
|
||||||
|
|
||||||
@ -28,13 +29,13 @@ export default class {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
sliceSync(settings) {
|
sliceSync(settings) {
|
||||||
return slice(this.geometry, settings);
|
return slice(this.geometry, new Settings(settings));
|
||||||
}
|
}
|
||||||
slice(settings) {
|
slice(settings) {
|
||||||
const slicerWorker = new SlicerWorker();
|
const slicerWorker = new SlicerWorker();
|
||||||
|
|
||||||
const geometry = this.geometry.toJSON();
|
const geometry = this.geometry.toJSON();
|
||||||
const { config } = settings;
|
const { config } = new Settings(settings);
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
slicerWorker.onerror = reject;
|
slicerWorker.onerror = reject;
|
||||||
|
20
src/index.js
20
src/index.js
@ -1,6 +1,18 @@
|
|||||||
import Slicer from './Slicer.js';
|
import Slicer from './Slicer.js';
|
||||||
import Settings from './Settings.js';
|
import defaultSettings from './settings/default.yml!text';
|
||||||
import printerSettings from './settings/printer_settings.json!json';
|
import printerSettings from './settings/printer.yml!text';
|
||||||
import userSettings from './settings/user_settings.json!json';
|
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:
|
low:
|
||||||
|
title: "Low"
|
||||||
layerHeight: .2
|
layerHeight: .2
|
||||||
medium:
|
medium:
|
||||||
|
title: "Medium"
|
||||||
layerHeight: .15
|
layerHeight: .15
|
||||||
height:
|
height:
|
||||||
|
title: "High"
|
||||||
layerHeight: .1
|
layerHeight: .1
|
||||||
|
@ -3,7 +3,7 @@ import * as THREE from 'three.js';
|
|||||||
export default function calculateLayersIntersections(lines, settings) {
|
export default function calculateLayersIntersections(lines, settings) {
|
||||||
console.log('calculating layer intersections');
|
console.log('calculating layer intersections');
|
||||||
|
|
||||||
const { layerHeight, dimensionsZ } = settings.config;
|
const { layerHeight, dimensions: { z: dimensionsZ } } = settings.config;
|
||||||
|
|
||||||
const numLayers = Math.floor(dimensionsZ / layerHeight);
|
const numLayers = Math.floor(dimensionsZ / layerHeight);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user