updated to three.js r72

This commit is contained in:
casperlamboo 2015-10-14 17:11:29 +02:00 committed by Simon Voordouw
parent 4526307df4
commit d367fbe021
7 changed files with 29 additions and 29 deletions

2
.gitignore vendored
View File

@ -2,3 +2,5 @@
*.DS_Store
jspm_packages/*
bundle.js

View File

@ -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({
}
}
});

View File

@ -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);

View File

@ -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",

View File

@ -161,4 +161,4 @@ export default class {
getGCode () {
return this.settings.startCode() + this.gcode + this.settings.endCode();
}
}
}

View File

@ -55,4 +55,4 @@ export default class {
return gcode;
}
}
}

View File

@ -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 = [];