Commit 7b8fd143 authored by amandaghassaei's avatar amandaghassaei
Browse files

max strain clip

parent f35fd711
...@@ -493,6 +493,10 @@ ...@@ -493,6 +493,10 @@
<input name="colorMode" value="axialStrain" data-toggle="radio" class="custom-radio" type="radio"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span> <input name="colorMode" value="axialStrain" data-toggle="radio" class="custom-radio" type="radio"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
Axial Strain Material<a class="about floatRight" href="#" id="aboutAxialStrain"><span class="fui-question-circle"></span></a> Axial Strain Material<a class="about floatRight" href="#" id="aboutAxialStrain"><span class="fui-question-circle"></span></a>
</label> </label>
<div id="axialStrainMaterialOptions" class="indent">
<label>Max Strain: &nbsp;&nbsp;</label>
<input id="strainClip" value="" placeholder="" class="float form-control" type="text"> %<br/>
</div>
</div> </div>
</div><br/> </div><br/>
Edges: Edges:
......
...@@ -347,10 +347,14 @@ function initControls(globals){ ...@@ -347,10 +347,14 @@ function initControls(globals){
if (globals.colorMode == "color") $("#coloredMaterialOptions").show(); if (globals.colorMode == "color") $("#coloredMaterialOptions").show();
else $("#coloredMaterialOptions").hide(); else $("#coloredMaterialOptions").hide();
if (globals.colorMode == "axialStrain") $("#axialStrainMaterialOptions").show();
else $("#axialStrainMaterialOptions").hide();
setRadio("colorMode", globals.colorMode, function(val){ setRadio("colorMode", globals.colorMode, function(val){
globals.colorMode = val; globals.colorMode = val;
if (val == "color") $("#coloredMaterialOptions").show(); if (val == "color") $("#coloredMaterialOptions").show();
else $("#coloredMaterialOptions").hide(); else $("#coloredMaterialOptions").hide();
if (val == "axialStrain") $("#axialStrainMaterialOptions").show();
else $("#axialStrainMaterialOptions").hide();
globals.model.setMeshMaterial(); globals.model.setMeshMaterial();
}); });
...@@ -409,6 +413,10 @@ function initControls(globals){ ...@@ -409,6 +413,10 @@ function initControls(globals){
$("#aboutAxialStrainModal").modal("show"); $("#aboutAxialStrainModal").modal("show");
}); });
setInput("#strainClip", globals.strainClip, function(val){
globals.strainClip = val;
}, 0.0001, 100);
function setButtonGroup(id, callback){ function setButtonGroup(id, callback){
$(id+" a").click(function(e){ $(id+" a").click(function(e){
e.preventDefault(); e.preventDefault();
......
...@@ -179,7 +179,7 @@ function initDynamicSolver(globals){ ...@@ -179,7 +179,7 @@ function initDynamicSolver(globals){
positions[3*i+1] = nexPos.y; positions[3*i+1] = nexPos.y;
positions[3*i+2] = nexPos.z; positions[3*i+2] = nexPos.z;
if (colors){ if (colors){
var scaledVal = (1-nodeError/globals.errorClip) * 0.7; var scaledVal = (1-100*nodeError/globals.strainClip) * 0.7;
var color = new THREE.Color(); var color = new THREE.Color();
color.setHSL(scaledVal, 1, 0.5); color.setHSL(scaledVal, 1, 0.5);
colors[3*i] = color.r; colors[3*i] = color.r;
......
...@@ -44,7 +44,7 @@ function initGlobals(){ ...@@ -44,7 +44,7 @@ function initGlobals(){
percentDamping: 1, percentDamping: 1,
density: 1, density: 1,
errorClip: 0.05, strainClip: 5.0,
//import pattern settings //import pattern settings
vertTol: 3,//vertex merge tolerance vertTol: 3,//vertex merge tolerance
......
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