Commit 07d813db authored by amandaghassaei's avatar amandaghassaei
Browse files

eod

parent 04b418ba
......@@ -42,9 +42,9 @@ Crease.prototype.getTargetTheta = function(){
};
Crease.prototype.getK = function(){
// var length = this.getLength(); //todo *length?
if (this.type == 0) return globals.panelStiffness;
return globals.creaseStiffness;
var length = this.getLength(); //todo *length?
if (this.type == 0) return globals.panelStiffness*length;
return globals.creaseStiffness*length;
};
Crease.prototype.getD = function(){
......
......@@ -58,7 +58,6 @@ function initModel(globals){
var _creases = [];
for (var i=0;i<allCreaseParams.length;i++) {//allCreaseParams.length
var creaseParams = allCreaseParams[i];//face1Ind, vertInd, face2Ind, ver2Ind, edgeInd, angle
_edges[creaseParams[4]].highlight();
_creases.push(new Crease(_edges[creaseParams[4]], creaseParams[0], creaseParams[2], creaseParams[5], 1, _nodes[creaseParams[1]], _nodes[creaseParams[3]], _creases.length));
}
......
......@@ -177,7 +177,7 @@ function initStaticSolver(){
var length = edge.getOriginalLength();
var diff = edgeVector0.length() - length;
var rxnForceScale = globals.axialStiffness*diff;
var rxnForceScale = globals.axialStiffness*diff/length;
edgeVector0.normalize();
if (!_nodes[0].fixed) {
......@@ -222,10 +222,10 @@ function initStaticSolver(){
if (!crease.node1.fixed){
var i = indicesMapping.indexOf(crease.node1.getIndex());
var dist = crease.getLengthToNode1();
C[j+numFreeEdges][3*i] = -normal1.x;//todo not sure about sign
C[j+numFreeEdges][3*i+1] = -normal1.y;
C[j+numFreeEdges][3*i+2] = -normal1.z;
rxnForceScale = crease.getK()*diff;
C[j+numFreeEdges][3*i] = -normal1.x/dist;//todo not sure about sign
C[j+numFreeEdges][3*i+1] = -normal1.y/dist;
C[j+numFreeEdges][3*i+2] = -normal1.z/dist;
rxnForceScale = crease.getK()*diff/dist;
F_rxn[3*i] += normal1.x*rxnForceScale;
F_rxn[3*i+1] += normal1.y*rxnForceScale;
F_rxn[3*i+2] += normal1.z*rxnForceScale;
......@@ -234,10 +234,10 @@ function initStaticSolver(){
var i = indicesMapping.indexOf(crease.node2.getIndex());
// console.log(normal);
var dist = crease.getLengthToNode2();
C[j+numFreeEdges][3*i] = -normal2.x;///dist;
C[j+numFreeEdges][3*i+1] = -normal2.y;///dist;
C[j+numFreeEdges][3*i+2] = -normal2.z;///dist;
rxnForceScale = crease.getK()*diff;///dist;
C[j+numFreeEdges][3*i] = -normal2.x/dist;
C[j+numFreeEdges][3*i+1] = -normal2.y/dist;
C[j+numFreeEdges][3*i+2] = -normal2.z/dist;
rxnForceScale = crease.getK()*diff/dist;
F_rxn[3*i] += normal2.x*rxnForceScale;
F_rxn[3*i+1] += normal2.y*rxnForceScale;
F_rxn[3*i+2] += normal2.z*rxnForceScale;
......@@ -248,7 +248,7 @@ function initStaticSolver(){
function calcQ() {
var axialStiffness = globals.axialStiffness;
for (var i = 0; i < numFreeEdges; i++) {
Q[i][i] = axialStiffness;
Q[i][i] = axialStiffness/edges[freeEdgesMapping[i]].getOriginalLength();
}
for (var i = 0; i < numFreeCreases; i++) {
var crease = creases[freeCreasesMapping[i]];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment