Commit 7f78a9ab authored by amandaghassaei's avatar amandaghassaei

save fold options

parent bf0688d7
......@@ -57,6 +57,19 @@ function initGlobals(){
doublesidedSTL: false,
exportScale: 1,
//save fold settings
foldUnits: "unit",
allFOLDUnits:{
unit: "unitless",
in: "in",
pt: "pt",
m: "m",
cm: "cm",
mm: "mm",
um: "um",
nm: "nm"
},
userInteractionEnabled: false
};
......
......@@ -17,12 +17,24 @@ function saveFOLD(){
}
}
// var data = [];
// data.push({geo: geo, offset:new THREE.Vector3(0,0,0), orientation:new THREE.Quaternion(0,0,0,1)});
// var stlBin = geometryToSTLBin(data);
// if (!stlBin) return;
// var blob = new Blob([stlBin], {type: 'application/octet-binary'});
var filename = $("#foldFilename").val();
if (filename == "") filename = globals.filename;
var json = {
file_spec: 1,
file_creator: "Origami Simulator: http://git.amandaghassaei.com/OrigamiSimulator/",
file_author: "",
frame_title: filename,
frame_classes: ["singleModel"],
frame_attributes: ["3D"],
frame_description: "",
frame_unit: globals.foldUnits,
vertices_coords: [],
edges_vertices: [],
edges_foldAngles: [],
faces_vertices: []
};
var blob = new Blob([JSON.stringify(json)], {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