diff --git a/assets/stls/parts/KennyTeqPart.stl b/assets/stls/parts/KennyTeqPart.stl new file mode 100644 index 0000000000000000000000000000000000000000..40ca3198b63cd714c64d3098fd26ae7ba5827a98 Binary files /dev/null and b/assets/stls/parts/KennyTeqPart.stl differ diff --git a/js/cells/OctaVertexCell.js b/js/cells/OctaVertexCell.js index 4390c9045d01d077e6c9ee68e11eb24959a7597d..791a80ddd92d84747223f292074dca5ed852b6e2 100644 --- a/js/cells/OctaVertexCell.js +++ b/js/cells/OctaVertexCell.js @@ -17,6 +17,21 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cell'], return unitGeo; }; + OctaVertexCell.prototype._initParts = function(callback){ + var self = this; + var type = lattice.get("partType"); + if (type == "kennyTeq") type = "kennyTeqPart"; + else console.warn("no part type " + type); + + require([type], function(PartClass){ + var parts = []; + for (var i=0;i<3;i++){ + parts.push(new PartClass(0, self)); + } + callback(parts); + }); + }; + OctaVertexCell.prototype.calcHighlighterParams = function(face, point){ // point.applyQuaternion(this.getAbsoluteOrientation()); diff --git a/js/lattice/CompositeEditorLattice.js b/js/lattice/CompositeEditorLattice.js index ecf86628270e97e46427dc82a5cecb31b6ad8a14..83bd8f57edcb6c5786b0556ce814deaa6551518e 100644 --- a/js/lattice/CompositeEditorLattice.js +++ b/js/lattice/CompositeEditorLattice.js @@ -87,7 +87,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre var cellsMin = this.get("cellsMin"); var cellsMax = this.get("cellsMax"); if (cellsMax) { - console.log(bounds.min); +// console.log(bounds.min); cellsMax = cellsMax.clone(); cellsMax.sub(cellsMin).sub(bounds.min); cellsMin = new THREE.Vector3(0,0,0).sub(bounds.min); diff --git a/js/main.js b/js/main.js index b917a5049a5ea3523940b19929d22378134e9a5a..297c79074eb1b68dca4afe1996757297a1b7720b 100644 --- a/js/main.js +++ b/js/main.js @@ -87,6 +87,7 @@ require.config({ octaEdgeVoxPartLowPoly: 'parts/OctaEdgeVoxPartLowPoly', gikPart: 'parts/GIKPart', gikPartLowPoly: 'parts/GIKPartLowPoly', + kennyTeqPart: 'parts/KennyTeqPart', //materials materials: 'materials/DMAMaterials', @@ -149,6 +150,7 @@ require.config({ gikEndPartSTL: 'assets/stls/parts/GIKEndPart.stl', gikPartLowPolySTL: 'assets/stls/parts/GIKPartLowPoly.stl', gikEndPartLowPolySTL: 'assets/stls/parts/GIKEndPartLowPoly.stl', + kennyTeqPartSTL: 'assets/stls/parts/KennyTeqPart.stl', crabSTL: 'assets/stls/crab/crab.stl' }, diff --git a/js/models/PList.js b/js/models/PList.js index 8239164f2c0ad0d1daf367687474303a0f8ae436..e76b6017f0c5e2b3c656ec4d14149ef466fe6099 100644 --- a/js/models/PList.js +++ b/js/models/PList.js @@ -60,10 +60,11 @@ define(['three'], function(THREE){ vox: "Snap Voxel (high res)", voxLowPoly: "Snap Voxel (low res)" }, - vertex: null,//{ + vertex: { + kennyTeq: "Kenny Teq" // square:"Square", // xShape:"X" -// } + } }, tetra: {vertex: null}, cube: {face: null, diff --git a/js/parts/KennyTeqPart.js b/js/parts/KennyTeqPart.js new file mode 100644 index 0000000000000000000000000000000000000000..2e801c055a2aef9a84a850dbe5fd1334ecd95ca2 --- /dev/null +++ b/js/parts/KennyTeqPart.js @@ -0,0 +1,22 @@ +/** + * Created by aghassaei on 6/26/15. + */ + +define(['underscore', 'three', 'part', 'bin!kennyTeqPartSTL', 'stlLoader'], function(_, THREE, DMAPart, kennyPart){ + + var loader = new THREE.STLLoader(); + var unitGeo = loader.parse(kennyPart); + var unitScale = 1/6.9597; + unitGeo.applyMatrix(new THREE.Matrix4().makeScale(unitScale, unitScale, unitScale)); + + function KennyTeqPart(type, parent){ + DMAPart.call(this, type, parent); + } + KennyTeqPart.prototype = Object.create(DMAPart.prototype); + + KennyTeqPart.prototype._getGeometry = function(){ + return unitGeo; + }; + + return KennyTeqPart; +}); \ No newline at end of file