-
Amira Abdel-Rahman authoredAmira Abdel-Rahman authored
main.js 32.28 KiB
// Amira Abdel-Rahman
// (c) Massachusetts Institute of Technology 2019
var color1= 0xffffff; /*white*/
var color2= 0x020227; /*kohly*/
var color3= 0x1c5c61; /*teal*/
var color4= "#fa6e70"; //red/orange
var color5="#380152"; //purple
var color6="#696767"; //grey
var color7="#03dbfc"; //blue
///////////globals (in case of hierarichal)/////////////
var camera;
var gui = new dat.GUI();
var clock = new THREE.Clock();
var timeElapsed = clock.getElapsedTime();
var currTimeStep=0;
var increase=true;
var setupEmpty={//empty
nodes: [
],
edges: [
],
//material properties - AISI 1095 Carbon Steel (Spring Steel)
ndofs : 3*6,
animation : {
showDisplacement : false,
exaggeration : 1000,
speed:3.0
},
viz : {
minStress:10e6,
maxStress: -10e6,
colorMaps:[coolwarm,YlGnBu, winter ,jet],
colorMap:0,
},
};
var setup=JSON.parse(JSON.stringify(setupEmpty));
function animate(){
timeElapsed = clock.getElapsedTime();
requestAnimationFrame(animate);
if(increase){
currTimeStep+=setup.animation.speed*setup.animation.speed*2.0; //todo change to globalSetup
}else{
currTimeStep-=setup.animation.speed*setup.animation.speed*2.0; //todo change to globalSetup
}
}
animate();
///////////////////////////////
////////////threejs object and utils//////////////////////
function threejs(setup,containerName,container1Name,static=true,live=false,empty=false){
// this.line;
this.setup=setup;
this.renderer;
this.scene;