mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-23 11:33:49 +01:00
updated to three.js r72
This commit is contained in:
parent
fa38d8117e
commit
0f6c73e93f
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,3 +2,5 @@
|
||||
*.DS_Store
|
||||
|
||||
jspm_packages/*
|
||||
|
||||
bundle.js
|
||||
|
22
config.js
22
config.js
@ -1,20 +1,21 @@
|
||||
System.config({
|
||||
"baseURL": "/",
|
||||
"defaultJSExtensions": true,
|
||||
"transpiler": "babel",
|
||||
"babelOptions": {
|
||||
baseURL: "/",
|
||||
defaultJSExtensions: true,
|
||||
transpiler: "babel",
|
||||
babelOptions: {
|
||||
"optional": [
|
||||
"runtime"
|
||||
]
|
||||
},
|
||||
"paths": {
|
||||
paths: {
|
||||
"github:*": "jspm_packages/github/*",
|
||||
"npm:*": "jspm_packages/npm/*"
|
||||
}
|
||||
});
|
||||
},
|
||||
bundles: {
|
||||
"bundle.js": []
|
||||
},
|
||||
|
||||
System.config({
|
||||
"map": {
|
||||
map: {
|
||||
"babel": "npm:babel-core@5.8.21",
|
||||
"babel-runtime": "npm:babel-runtime@5.8.20",
|
||||
"clipper-lib": "npm:clipper-lib@1.0.0",
|
||||
@ -23,7 +24,7 @@ System.config({
|
||||
"nodeca/js-yaml": "github:nodeca/js-yaml@3.3.1",
|
||||
"read-yaml": "npm:read-yaml@1.0.0",
|
||||
"systemjs/plugin-json": "github:systemjs/plugin-json@0.1.0",
|
||||
"three.js": "github:mrdoob/three.js@master",
|
||||
"three.js": "github:mrdoob/three.js@r72",
|
||||
"github:jspm/nodelibs-assert@0.1.0": {
|
||||
"assert": "npm:assert@1.3.0"
|
||||
},
|
||||
@ -92,4 +93,3 @@ System.config({
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -3,19 +3,17 @@ import PRINTER_SETTINGS from 'settings/printer_settings.json!';
|
||||
import USER_SETTINGS from 'settings/user_settings.json!';
|
||||
import * as SLICER from 'src/index';
|
||||
|
||||
setTimeout(() => {
|
||||
var settings = new SLICER.Settings();
|
||||
settings.updateConfig(PRINTER_SETTINGS["ultimaker2go"]);
|
||||
settings.updateConfig(USER_SETTINGS);
|
||||
var settings = new SLICER.Settings();
|
||||
settings.updateConfig(PRINTER_SETTINGS["ultimaker2go"]);
|
||||
settings.updateConfig(USER_SETTINGS);
|
||||
|
||||
var geometry = new THREE.TorusGeometry(20, 10, 30, 30);
|
||||
var geometry = new THREE.TorusGeometry(20, 10, 30, 30);
|
||||
|
||||
var slicer = new SLICER.Slicer();
|
||||
//var slicer = new SLICER.SlicerWorker();
|
||||
var slicer = new SLICER.Slicer();
|
||||
//var slicer = new SLICER.SlicerWorker();
|
||||
|
||||
slicer.setGeometry(geometry.clone());
|
||||
slicer.onfinish = function (gCode) {
|
||||
document.getElementById('gcode').innerHTML = gCode.replace(/(?:\r\n|\r|\n)/g, '<br />');
|
||||
};
|
||||
slicer.slice(settings);
|
||||
});
|
||||
slicer.setGeometry(geometry.clone());
|
||||
slicer.onfinish = function (gCode) {
|
||||
document.getElementById('gcode').innerHTML = gCode.replace(/(?:\r\n|\r|\n)/g, '<br />');
|
||||
};
|
||||
slicer.slice(settings);
|
||||
|
@ -9,7 +9,7 @@
|
||||
"nodeca/js-yaml": "github:nodeca/js-yaml@^3.3.1",
|
||||
"read-yaml": "npm:read-yaml@^1.0.0",
|
||||
"systemjs/plugin-json": "github:systemjs/plugin-json@^0.1.0",
|
||||
"three.js": "github:mrdoob/three.js@master"
|
||||
"three.js": "github:mrdoob/three.js@r72"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel": "npm:babel-core@^5.1.13",
|
||||
|
@ -30,7 +30,7 @@ export default class {
|
||||
if (geometry.type === 'BufferGeometry') {
|
||||
geometry = new THREE.Geometry().fromBufferGeometry(geometry);
|
||||
}
|
||||
else if (geometry.type === 'Geometry') {
|
||||
else if (geometry.type.endsWith('Geometry')) {
|
||||
geometry = geometry.clone();
|
||||
}
|
||||
else {
|
||||
@ -138,7 +138,7 @@ export default class {
|
||||
var layerHeight = settings.config["layerHeight"];
|
||||
var height = settings.config["dimensionsZ"];
|
||||
|
||||
var numLayers = height / layerHeight;
|
||||
var numLayers = Math.floor(height / layerHeight);
|
||||
|
||||
var layerIntersectionIndexes = [];
|
||||
var layerIntersectionPoints = [];
|
||||
|
Loading…
Reference in New Issue
Block a user