Commit f6c3decd authored by amandaghassaei's avatar amandaghassaei
Browse files

small changes

parent 9bebc352
...@@ -406,6 +406,7 @@ ...@@ -406,6 +406,7 @@
<li><a id="navPattern" href="#">Pattern</a></li> <li><a id="navPattern" href="#">Pattern</a></li>
<li><a id="navSimulation" href="#">Simulation</a></li> <li><a id="navSimulation" href="#">Simulation</a></li>
<li><a id="about" class="menuHoverControls" target="_blank" href="#">About</a></li> <li><a id="about" class="menuHoverControls" target="_blank" href="#">About</a></li>
<li><a id="tips" class="menuHoverControls" target="_blank" href="#">File Import Tips</a></li>
</ul> </ul>
</div><!-- /.navbar-collapse --> </div><!-- /.navbar-collapse -->
...@@ -532,6 +533,17 @@ ...@@ -532,6 +533,17 @@
</div><!-- /.modal-content --> </div><!-- /.modal-content -->
</div><!-- /.modal-dialog --> </div><!-- /.modal-dialog -->
</div><!-- /.modal --> </div><!-- /.modal -->
<div class="modal fade" id="tipsModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-body">
<p><b>File Import Tips</b><br/><br/>
....
</p>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="modal fade" id="exportSTLModal" tabindex="-1" role="dialog"> <div class="modal fade" id="exportSTLModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-med"> <div class="modal-dialog modal-med">
<div class="modal-content"> <div class="modal-content">
......
...@@ -17,6 +17,9 @@ function initControls(globals){ ...@@ -17,6 +17,9 @@ function initControls(globals){
setLink("#about", function(){ setLink("#about", function(){
$('#aboutModal').modal('show'); $('#aboutModal').modal('show');
}); });
setLink("#tips", function(){
$('#tipsModal').modal('show');
});
setLink("#exportSTL", function(){ setLink("#exportSTL", function(){
$('#exportSTLModal').modal('show'); $('#exportSTLModal').modal('show');
...@@ -112,7 +115,11 @@ function initControls(globals){ ...@@ -112,7 +115,11 @@ function initControls(globals){
parseTXTjson(json); parseTXTjson(json);
}); });
} else globals.pattern.loadSVG("assets/" + url); } else {
globals.filename = name;
globals.extension = extension;
globals.pattern.loadSVG("assets/" + url);
}
} }
}); });
......
...@@ -47,8 +47,10 @@ function initGlobals(){ ...@@ -47,8 +47,10 @@ function initGlobals(){
//import pattern settings //import pattern settings
vertTol: 3,//vertex merge tolerance vertTol: 3,//vertex merge tolerance
//save stl settings
filename: null, filename: null,
extension: null extension: null,
doublesidedSTL: false
}; };
......
...@@ -4,11 +4,16 @@ ...@@ -4,11 +4,16 @@
function saveSTL(){ function saveSTL(){
var geo = globals.model.getGeometry(); var geo = globals.model.getGeometry().clone();
if (geo.vertices.length == 0) { if (geo.vertices.length == 0) {
globals.warn("No geometry to save."); globals.warn("No geometry to save.");
return; return;
} }
if (!globals.doublesidedSTL){
for (var i=0;i<geo.faces.length/2;i++){
geo.faces.pop();
}
}
var data = []; var data = [];
data.push({geo: geo, offset:new THREE.Vector3(0,0,0), orientation:new THREE.Quaternion(0,0,0,1)}); data.push({geo: geo, offset:new THREE.Vector3(0,0,0), orientation:new THREE.Quaternion(0,0,0,1)});
......
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