From 5a6468baef0c806f3121bd61706a8c354c1dbbc9 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Mon, 26 Mar 2018 10:28:43 +0200 Subject: [PATCH] fix orientation of printed doodles #43 --- src/interface/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/interface/utils.js b/src/interface/utils.js index 4492f5e..bedfaa8 100644 --- a/src/interface/utils.js +++ b/src/interface/utils.js @@ -177,7 +177,10 @@ export async function slice(action, name, mesh, settings, updateProgress) { const centerX = dimensions.x / 2; const centerY = dimensions.y / 2; - const matrix = new THREE.Matrix4().makeTranslation(centerY, 0, centerX).multiply(mesh.matrix); + const matrix = new THREE.Matrix4().makeRotationY(-Math.PI / 2.0) + .multiply(new THREE.Matrix4().makeTranslation(centerY, 0, centerX)) + .multiply(mesh.matrix); + const { gcode } = await sliceGeometry(settings, mesh.geometry, mesh.material, matrix, false, false, ({ progress }) => { updateProgress({ action: progress.action,