Commit 1156820b authored by amandaghassaei's avatar amandaghassaei

save fold options

parent 7f78a9ab
......@@ -123,10 +123,6 @@ input.form-control {
float:right;
}
.modal-body li{
margin-bottom:10px;
}
#threeContainer {
width:100%;
height:100%;
......@@ -233,10 +229,6 @@ span.modal-close{
color: #666;
}
.modal-footer .btn+.btn {
background: #eee;
}
.radio .icon-checked{
transition-duration: 0s;
}
......@@ -339,3 +331,12 @@ svg{
input.form-control.bigInput{
width:300px;
}
.actionButton{
width: 100px;
}
#unitsDropdown{
height: 100px;
overflow: auto;
}
\ No newline at end of file
......@@ -598,20 +598,18 @@
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<p><b>Export STL</b><br/><br/>
Filename: &nbsp;&nbsp;<input id="stlFilename" value="" placeholder="" class="bigInput text form-control" type="text"> .stl<br/><br/>
Scale: &nbsp;&nbsp;<input value="" placeholder="" class="exportScale form-control" type="text"><br/><br/>
Dimensions: &nbsp;&nbsp;<b><span class="exportDimensions"></span></b><br/>
<span class="smallTxt">(the STL file format is unitless, but typically assumed to be either in inches or mm)</span><br/><br/>
<label class="bigLabel checkbox" for="doublesidedSTL">
<input id="doublesidedSTL" data-toggle="checkbox" class="custom-checkbox layersSelector" type="checkbox"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
Double Sided
</label>
</p>
<b>Export STL</b><br/><br/>
Filename: &nbsp;&nbsp;<input id="stlFilename" value="" placeholder="" class="bigInput text form-control" type="text"> .stl<br/><br/>
Scale: &nbsp;&nbsp;<input value="" placeholder="" class="exportScale form-control" type="text"><br/><br/>
Dimensions: &nbsp;&nbsp;<b><span class="exportDimensions"></span></b><br/>
<span class="smallTxt">(the STL file format is unitless, but typically assumed to be either in inches or mm)</span><br/><br/>
<label class="bigLabel checkbox" for="doublesidedSTL">
<input id="doublesidedSTL" data-toggle="checkbox" class="custom-checkbox layersSelector" type="checkbox"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
Double Sided
</label>
</div>
<div class="modal-footer">
<button id="doSTLsave" type="button" class="btn btn-success" data-dismiss="modal">Save</button>
<button type="button" class="btn btn default" data-dismiss="modal">Cancel</button>
<button id="doSTLsave" type="button" class="actionButton btn btn-success" data-dismiss="modal">Save</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
......@@ -623,18 +621,29 @@
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<p><b>Export FOLD</b><br/><br/>
Filename: &nbsp;&nbsp;<input id="foldFilename" value="" placeholder="" class="bigInput text form-control" type="text"> .stl<br/><br/>
Author: &nbsp;&nbsp;<input id="foldAuthor" value="Amanda Ghassaei" placeholder="" class="bigInput text form-control" type="text"><br/><br/>
Scale: &nbsp;&nbsp;<input value="" placeholder="" class="exportScale form-control" type="text"><br/><br/>
Dimensions: &nbsp;&nbsp;<b><span class="exportDimensions"></span></b><br/>
<span class="smallTxt">(the FOLD file format is unitless)</span><br/><br/>
</p>
<b>Export FOLD</b><br/><br/>
Filename: &nbsp;&nbsp;<input id="foldFilename" value="" placeholder="" class="bigInput text form-control" type="text"> .stl<br/><br/>
Author: &nbsp;&nbsp;<input id="foldAuthor" value="Amanda Ghassaei" placeholder="" class="bigInput text form-control" type="text"><br/><br/>
Scale: &nbsp;&nbsp;<input value="" placeholder="" class="exportScale form-control" type="text">&nbsp;&nbsp;&nbsp;&nbsp;
Units: &nbsp;&nbsp;
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-default dropdown-toggle" type="button"><span id="unitsDisplay"></span> <span class="caret"></span></button>
<ul id="unitsDropdown" role="menu" class="dropdown-menu">
<li><a data-id="unit" href="#">unitless</a></li>
<li><a data-id="in" href="#">in</a></li>
<li><a data-id="pt" href="#">pt</a></li>
<li><a data-id="m" href="#">m</a></li>
<li><a data-id="cm" href="#">cm</a></li>
<li><a data-id="mm" href="#">mm</a></li>
<li><a data-id="um" href="#">um</a></li>
<li><a data-id="nm" href="#">nm</a></li>
</ul>
</div>
<br/><br/>
Dimensions: &nbsp;&nbsp;<b><span class="exportDimensions"></span></b>
</div>
<div class="modal-footer">
<button id="doFOLDsave" type="button" class="btn btn-success" data-dismiss="modal">Save</button>
<button type="button" class="btn btn default" data-dismiss="modal">Cancel</button>
<button id="doFOLDsave" type="button" class="actionButton btn btn-success" data-dismiss="modal">Save</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
......@@ -646,12 +655,11 @@
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<p><b>Import FOLD</b><br/><br/>
<b>Import FOLD</b><br/><br/>
<label class="checkbox" for="foldUseAngles">
<input id="foldUseAngles" data-toggle="checkbox" class="custom-checkbox layersSelector" type="checkbox"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
Use current angles as target fold angles
</label>
</p>
</div>
<div class="modal-footer">
<button data-dismiss="modal" type="button" class="btn btn-success">OK</button>
......
......@@ -24,6 +24,9 @@ function initControls(globals){
setLink("#exportFOLD", function(){
updateDimensions();
$("#foldFilename").val(globals.filename + " : " + parseInt(globals.creasePercent*100) + "PercentFolded");
var units = globals.foldUnits;
if (units == "unit") units = "unitless";
$("#unitsDisplay").html(units);
$('#exportFOLDModal').modal('show');
});
setLink("#exportSTL", function(){
......@@ -51,7 +54,6 @@ function initControls(globals){
saveFOLD();
});
setLink("#navPattern", function(){
if (globals.noCreasePatternAvailable()){
globals.warn("No crease pattern available for FOLD format.");
......
......@@ -59,16 +59,6 @@ function initGlobals(){
//save fold settings
foldUnits: "unit",
allFOLDUnits:{
unit: "unitless",
in: "in",
pt: "pt",
m: "m",
cm: "cm",
mm: "mm",
um: "um",
nm: "nm"
},
userInteractionEnabled: false
......
......@@ -23,7 +23,7 @@ function saveFOLD(){
var json = {
file_spec: 1,
file_creator: "Origami Simulator: http://git.amandaghassaei.com/OrigamiSimulator/",
file_author: "",
file_author: $("#foldAuthor").val(),
frame_title: filename,
frame_classes: ["singleModel"],
frame_attributes: ["3D"],
......@@ -35,6 +35,6 @@ function saveFOLD(){
faces_vertices: []
};
var blob = new Blob([JSON.stringify(json)], {type: 'application/octet-binary'});
var blob = new Blob([JSON.stringify(json, null, 4)], {type: 'application/octet-binary'});
saveAs(blob, filename + ".fold");
}
\ No newline at end of file
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