fix orientation of printed doodles

#43
This commit is contained in:
Casper Lamboo 2018-03-26 10:28:43 +02:00
parent 763c6e08e8
commit 5a6468baef

View File

@ -177,7 +177,10 @@ export async function slice(action, name, mesh, settings, updateProgress) {
const centerX = dimensions.x / 2; const centerX = dimensions.x / 2;
const centerY = dimensions.y / 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 }) => { const { gcode } = await sliceGeometry(settings, mesh.geometry, mesh.material, matrix, false, false, ({ progress }) => {
updateProgress({ updateProgress({
action: progress.action, action: progress.action,