added time logging for slicing

This commit is contained in:
casperlamboo 2015-05-07 18:14:10 +02:00
parent fad6b6b3c2
commit 4d89f2161c
2 changed files with 17 additions and 4 deletions

View File

@ -103,9 +103,9 @@ var geometry = (function () {
})();
var material = new THREE.MeshLambertMaterial({color: 0x000000, wireframe: true});
var geometry = new THREE.TorusGeometry(20, 10, 30, 30);
//var geometry = new THREE.TorusGeometry(20, 10, 30, 30);
//var geometry = new THREE.BoxGeometry(20, 5, 20, 1, 1, 1);
//var geometry = new THREE.SphereGeometry(10, 10, 10);
var geometry = new THREE.SphereGeometry(10, 10, 10);
var mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);

View File

@ -163,7 +163,6 @@ D3D.Slicer.prototype.slice = function (height, step) {
//think this check is not nescesary, always higher as 0
if (shape.length > 0) {
shape.push({X: shape[0].X, Y: shape[0].Y});
slice.push(shape);
}
}
@ -482,13 +481,22 @@ D3D.Slicer.prototype.getGcode = function (printer) {
var layerHeight = printer.config["printer.layerHeight"];
var dimensionsZ = printer.config["printer.dimensions.z"];
var start = new Date().getTime();
var slices = this.slice(dimensionsZ, layerHeight);
var end = new Date().getTime();
console.log("Slicing: " + (end - start) + "ms");
//still error in first layer, so remove first layer
//see https://github.com/Doodle3D/Doodle3D-Slicer/issues/1
slices.shift();
var start = new Date().getTime();
var data = this.slicesToData(slices, printer);
var end = new Date().getTime();
console.log("Data: " + (end - start) + "ms");
//return data;
//TODO
@ -496,6 +504,11 @@ D3D.Slicer.prototype.getGcode = function (printer) {
//make the printer follow the shortest path from line to line
//see https://github.com/Ultimaker/CuraEngine#gcode-generation
var start = new Date().getTime();
var gcode = this.dataToGcode(data, printer);
var end = new Date().getTime();
console.log("Gcode: " + (end - start) + "ms");
return gcode;
};