Skip to content
Snippets Groups Projects
Commit 69130290 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

filling out physical elements

parent c0f744ed
No related branches found
No related tags found
No related merge requests found
......@@ -3,12 +3,12 @@
*/
//a single beam
//a single beam, made from two nodes
function Beam(node1, node2) {
this.nodes = [node1, node2];
var self = this;
_.each(nodes, function(node){
_.each(nodes, function(node){//give each node a reference to the new beam it is connected to
node.addBeam(self);
});
}
......
/**
* Created by aghassaei on 1/14/15.
*/
//a Cell, a unit piece of the lattice
function Cell(nodes, config) {
this.parts = this._createParts(nodes, config);
};
Cell.prototype._createParts = function(nodes, config){
var parts = [];
for (var i=0;i<nodes.length;i++){
parts.push(new Part(nodes[i], config[i]));
}
return parts;
};
Cell.prototype.render = function(scene){
};
Cell.prototype.translate = function(dx, dy, dz){
};
Cell.prototype.rotate = function(rx, ry, rz){
};
......@@ -3,9 +3,11 @@
*/
//a part, element with a single material, handled by assembler
function Part(nodes, config) {//list of nodes, config tells how nodes are connected
self.nodes = nodes;
self.beams = self._createBeams(nodes, config);
this.nodes = nodes;
this.beams = this._createBeams(nodes, config);
};
Part.prototype._createBeams = function(nodes, config){
......@@ -25,3 +27,12 @@ Part.prototype.translate = function(dx, dy, dz){
Part.prototype.rotate = function(rx, ry, rz){
};
//matt's part
function PartTriangle(nodes){
}
PartTriangle.prototype = new Part(nodes, [[0,1],[1,2],[2,0]]);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment