From 53b93cd054311566845e271b37eeadfe3946817c Mon Sep 17 00:00:00 2001 From: Amanda Ghassaei <amandaghassaei@gmail.com> Date: Wed, 28 Jan 2015 13:12:42 -0500 Subject: [PATCH] correct octa geometry --- js/fea/dmaCell.js | 4 ++-- js/models/lattice.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/fea/dmaCell.js b/js/fea/dmaCell.js index 219bb256..f0cb89ef 100644 --- a/js/fea/dmaCell.js +++ b/js/fea/dmaCell.js @@ -7,7 +7,7 @@ (function () { - var octHeight = 3*30/8*Math.sqrt(5);//this isn't quite right + var octHeight = 2*30/Math.sqrt(6); var cellGeometry1 = new THREE.OctahedronGeometry(30/Math.sqrt(2)); cellGeometry1.applyMatrix(new THREE.Matrix4().makeRotationZ(-3*Math.PI/12)); @@ -37,7 +37,7 @@ DMACell.prototype._calcPositionForScale = function(scale){ var position = {}; var indices = this.indices; - var octHeight = 3*scale/8*Math.sqrt(5);//this isn't quite right + var octHeight = 2*scale/Math.sqrt(6); var triHeight = scale/2*Math.sqrt(3); position.x = indices.x*scale; position.y = indices.y*triHeight; diff --git a/js/models/lattice.js b/js/models/lattice.js index 164484c3..77c6462c 100644 --- a/js/models/lattice.js +++ b/js/models/lattice.js @@ -32,7 +32,7 @@ Lattice = Backbone.Model.extend({ //calc indices in cell matrix var scale = this.get("scale"); - var octHeight = 3*scale/8*Math.sqrt(5);//this isn't quite right + var octHeight = 2*scale/Math.sqrt(6); var triHeight = scale/2*Math.sqrt(3); var position = {}; position.x = Math.round(absPosition.x/scale); -- GitLab