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
13b86cc5
Commit
13b86cc5
authored
May 02, 2017
by
amandaghassaei
Browse files
small fixes
parent
a9ea10c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
js/controls.js
View file @
13b86cc5
...
...
@@ -140,7 +140,7 @@ function initControls(globals){
var
v2Index
=
faceVerts
.
indexOf
(
v2
);
if
(
v2Index
>=
0
){
creaseParams
.
push
(
j
);
if
(
v2Index
>
v1Index
)
{
if
(
v2Index
>
v1Index
)
{
//remove larger index first
faceVerts
.
splice
(
v2Index
,
1
);
faceVerts
.
splice
(
v1Index
,
1
);
}
else
{
...
...
@@ -160,11 +160,11 @@ function initControls(globals){
switch
(
json
.
edges
[
i
].
type
){
case
0
:
//rule lines
creaseParams
.
push
(
0
)
;
shouldSkip
=
true
;
break
;
case
1
:
//quad panels
creaseParams
.
push
(
null
);
//flag to set driven
creaseParams
.
push
(
0
);
break
;
case
2
:
//outline
...
...
js/crease.js
View file @
13b86cc5
...
...
@@ -3,7 +3,7 @@
*/
function
Crease
(
edge
,
face1Index
,
face2Index
,
targetTheta
,
type
,
node1
,
node2
,
index
){
//type = 0 panel, 1 crease
, -1 = driven
//type = 0 panel, 1 crease
//face1 corresponds to node1, face2 to node2
this
.
edge
=
edge
;
...
...
@@ -13,6 +13,7 @@ function Crease(edge, face1Index, face2Index, targetTheta, type, node1, node2, i
this
.
face1Index
=
face1Index
;
this
.
face2Index
=
face2Index
;
this
.
targetTheta
=
targetTheta
;
if
(
this
.
targetTheta
==
Math
.
PI
)
console
.
log
(
"
here
"
);
this
.
type
=
type
;
this
.
node1
=
node1
;
this
.
node2
=
node2
;
...
...
@@ -42,7 +43,6 @@ Crease.prototype.getTargetTheta = function(){
};
Crease
.
prototype
.
getK
=
function
(){
if
(
this
.
type
==
-
1
)
return
0
;
var
length
=
this
.
getLength
();
if
(
this
.
type
==
0
)
return
globals
.
panelStiffness
*
length
;
return
globals
.
creaseStiffness
*
length
;
...
...
js/model.js
View file @
13b86cc5
...
...
@@ -143,7 +143,6 @@ function initModel(globals){
for
(
var
i
=
0
;
i
<
allCreaseParams
.
length
;
i
++
)
{
//allCreaseParams.length
var
creaseParams
=
allCreaseParams
[
i
];
//face1Ind, vertInd, face2Ind, ver2Ind, edgeInd, angle
var
type
=
creaseParams
[
5
]
!=
0
?
1
:
0
;
if
(
creaseParams
[
5
]
===
null
)
type
=
-
1
;
//driven
_creases
.
push
(
new
Crease
(
_edges
[
creaseParams
[
4
]],
creaseParams
[
0
],
creaseParams
[
2
],
creaseParams
[
5
],
type
,
_nodes
[
creaseParams
[
1
]],
_nodes
[
creaseParams
[
3
]],
_creases
.
length
));
}
...
...
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