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

max strain clip

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