Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
OrigamiSimulator
Commits
7f78a9ab
Commit
7f78a9ab
authored
May 06, 2017
by
amandaghassaei
Browse files
save fold options
parent
bf0688d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
js/globals.js
View file @
7f78a9ab
...
...
@@ -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
};
...
...
js/saveFOLD.js
View file @
7f78a9ab
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment