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

eod

parent aafa25ae
No related branches found
No related tags found
No related merge requests found
/**
* Created by aghassaei on 8/25/15.
*/
/**
* Created by aghassaei on 8/25/15.
*/
/**
* Created by aghassaei on 8/25/15.
*/
/**
* Created by aghassaei on 8/25/15.
*/
define(['underscore', 'three'], function(_, THREE){
var num = 1;
function Joint(json){
this.object3D = new THREE.Object3D();
this._name = json.name || "Joint " + num++;
this._type = json.type || "prismatic";//revolute, continuous, prismatic, fixed, floating, planar
this.setParent(json.parent);
this._child = json.child;
this._origin = json.origin || new THREE.Vector3(0,0,0);//also euler rotation
this._axis = json.axis || new THREE.Vector3(1,0,0);
//this.limit
}
Joint.prototype.getName = function(){
return this._name;
};
Joint.prototype.setName = function(name){
this._name = name;
};
Joint.prototype.getType = function(){
return this._type;
};
Joint.prototype.setType = function(type){
this._type = type;
require([type.charAt(0).toUpperCase() + type.slice(1) + "Joint"], function(SubClass){
//init subclass
});
};
Joint.prototype.getParent = function(){
return this._parent;
};
Joint.prototype.setParent = function(parent){
if (this._parent === parent) return;
if (this._checkDescendants(parent)) {
console.warn("parent is already a child");
return;
}
this._parent = parent;
};
Joint.prototype._checkDescendants = function(parent){
if (this._child){
if (this._child === parent) return true;
else return this._child._checkDescendants(parent);
} else return false;
};
Joint.prototype.getChild = function(){
return this._child;
};
Joint.prototype.setChild = function(child){
this._child = child;
};
Joint.prototype.getObject3D = function(){
return this.object3D;
};
Joint.prototype.toJSON = function(){
return {
};
};
return Joint;
});
\ No newline at end of file
/**
* Created by aghassaei on 8/25/15.
*/
define(['underscore', 'three'], function(_, THREE){
var num = 1;
function Link(json){
this._name = json.name || "Link " + num++;
this._origin = json.origin || new THREE.Vector3(0,0,0);//also euler rotation
this._axis = json.axis || new THREE.Vector3(1,0,0);
this.object3D = new THREE.Object3D();
}
Link.prototype.getName = function(){
return this._name;
};
Link.prototype.setName = function(name){
this._name = name;
};
Link.prototype.getObject3D = function(){
return this.object3D;
};
Link.prototype.toJSON = function(){
return {
};
};
return Link;
});
\ No newline at end of file
......@@ -193,6 +193,8 @@ require.config({
assemblerPost: 'cam/assemblers/AssemblerPost',
component: 'cam/assemblers/Component',
stockComponent: 'cam/assemblers/StockComponent',
urdfJoint: 'cam/assemblers/URDFJoint',
urdfLink: 'cam/assemblers/URDfLink',
//processes
gcode: 'cam/processes/GCodeExporter',
......
......@@ -185,6 +185,15 @@ define(['three'], function(THREE){
}
},
allJointTypes: {
revolute: "Revolute",
continuous: "Continuous",
prismatic: "Prismatic",
fixed: "Fixed",
floating: "Floating",
planar: "Planar"
},
allAssemblyStrategies: {
raster: "Raster"
},
......
......@@ -67,7 +67,7 @@ define(['three'], function(THREE){
tabs:{
assembler:"Assembler",
assemblerSetup: "Setup",
cam: "Process",
cam: "Globals",
// editCamOutput: "Edit",
animate:"Preview"
},
......
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