Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
OrigamiSimulator
Commits
2cc2160b
Commit
2cc2160b
authored
Jun 01, 2017
by
amandaghassaei
Browse files
new crease patterns
parent
e94f9a8a
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
assets/Tessellations/huffmanExtrudedBoxes.svg
0 → 100644
View file @
2cc2160b
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
version=
"1.1"
id=
"Layer_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
width=
"3456px"
height=
"6912px"
viewBox=
"0 0 3456 6912"
enable-background=
"new 0 0 3456 6912"
xml:space=
"preserve"
>
<path
opacity=
"0.5"
fill=
"none"
stroke=
"#FF0000"
stroke-miterlimit=
"10"
d=
"M275.294,491.764H2416.46 M275.294,574.116H2416.46
M275.294,738.821H2416.46 M275.294,821.174H2416.46 M275.294,985.879H2416.46 M275.294,1068.23H2416.46 M275.294,1232.938H2416.46
M275.294,1315.289H2416.46 M275.294,1479.994H2416.46 M275.294,1562.348H2416.46 M275.294,1727.052H2416.46 M275.294,1809.404
H2416.46 M275.294,1974.109H2416.46 M275.294,2056.462H2416.46 M275.294,2221.167H2416.46 M275.294,2303.52H2416.46
M439.999,2468.225V327.059 M522.352,2468.225V327.059 M687.057,2468.225V327.059 M769.409,2468.225V327.059 M934.114,2468.225
V327.059 M1016.467,2468.225V327.059 M1181.172,2468.225V327.059 M1263.523,2468.225V327.059 M1428.229,2468.225V327.059
M1510.582,2468.225V327.059 M1675.287,2468.225V327.059 M1757.641,2468.225V327.059 M1922.345,2468.225V327.059 M2004.697,2468.225
V327.059 M2169.402,2468.225V327.059 M2251.755,2468.225V327.059"
/>
<path
fill=
"none"
stroke=
"#000000"
stroke-miterlimit=
"10"
d=
"M275.294,327.059H2416.46 M275.294,2468.225H2416.46
M275.294,2468.225V327.059 M2416.46,2468.225V327.059"
/>
<path
fill=
"none"
stroke=
"#0000FF"
stroke-miterlimit=
"10"
d=
"M357.646,327.059v164.705 M357.646,491.764l-82.354,82.354
M357.646,491.764l82.353,82.354 M275.294,656.469h164.705 M439.999,656.469l82.353-82.353 M439.999,656.469l82.353,82.354
M522.352,491.764l82.354,82.354 M604.704,574.116l82.353-82.354 M604.704,574.116v164.705 M439.999,327.059l82.353,82.353
M439.999,491.764l82.353-82.353 M687.057,409.411H522.352 M687.057,409.411l82.354-82.353 M687.057,409.411l82.354,82.353
M769.409,656.469l-82.353-82.353 M687.057,738.821l82.354-82.354 M851.762,327.059v164.705 M851.762,491.764l-82.353,82.354
M851.762,491.764l82.354,82.354 M769.409,656.469h164.705 M934.114,656.469l82.353-82.353 M934.114,656.469l82.353,82.354
M1016.467,491.764l82.354,82.354 M1098.818,574.116l82.354-82.354 M1098.818,574.116v164.705 M934.114,327.059l82.353,82.353
M934.114,491.764l82.353-82.353 M1181.172,409.411h-164.705 M1181.172,409.411l82.354-82.353 M1181.172,409.411l82.354,82.353
M1263.523,656.469l-82.353-82.353 M1181.172,738.821l82.354-82.354 M1345.877,327.059v164.705 M1263.523,574.116l82.354-82.354
M1345.877,491.764l82.354,82.354 M1263.523,656.469h164.705 M1428.229,656.469l82.354-82.353 M1428.229,656.469l82.354,82.354
M1510.582,491.764l82.354,82.354 M1592.936,574.116l82.353-82.354 M1592.936,574.116v164.705 M1428.229,327.059l82.354,82.353
M1428.229,491.764l82.354-82.353 M1675.287,409.411h-164.705 M1675.287,409.411l82.354-82.353 M1675.287,409.411l82.354,82.353
M1757.641,656.469l-82.354-82.353 M1675.287,738.821l82.354-82.354 M1839.992,327.059v164.705 M1839.992,491.764l-82.354,82.354
M1839.992,491.764l82.353,82.354 M1757.641,656.469h164.704 M1922.345,656.469l82.354-82.353 M1922.345,656.469l82.354,82.354
M2004.697,491.764l82.353,82.354 M2087.05,574.116l82.354-82.354 M2087.05,574.116v164.705 M1922.345,327.059l82.354,82.353
M1922.345,491.764l82.354-82.353 M2169.402,409.411h-164.705 M2169.402,409.411l82.353-82.353 M2169.402,409.411l82.353,82.353
M2251.755,656.469l-82.353-82.353 M2169.402,738.821l82.353-82.354 M2334.107,327.059v164.705 M2334.107,491.764l-82.354,82.354
M2334.107,491.764l82.353,82.354 M2251.755,656.469h164.705 M275.294,738.821l82.353,82.353 M357.646,821.174v164.705
M357.646,985.879l-82.354,82.354 M357.646,985.879l82.353,82.354 M357.646,821.174l82.353-82.353 M275.294,1150.584h164.705
M439.999,1150.584l82.353-82.354 M439.999,1150.584l82.353,82.354 M522.352,985.879l82.354,82.354 M604.704,1068.23l82.353-82.353
M604.704,1068.23v164.705 M439.999,821.174l82.353,82.354 M439.999,985.879l82.353-82.354 M687.057,903.525H522.352
M687.057,903.525l82.354-82.353 M687.057,903.525l82.354,82.354 M522.352,821.174l82.354-82.353 M687.057,821.174l-82.353-82.353
M687.057,1068.23l82.354,82.354 M687.057,1232.938l82.354-82.354 M769.409,738.821l82.353,82.353 M851.762,821.174v164.705
M851.762,985.879l-82.353,82.354 M851.762,985.879l82.354,82.354 M851.762,821.174l82.354-82.353 M769.409,1150.584h164.705
M934.114,1150.584l82.353-82.354 M934.114,1150.584l82.353,82.354 M1016.467,985.879l82.354,82.354 M1098.818,1068.23
l82.354-82.353 M1098.818,1068.23v164.705 M934.114,821.174l82.353,82.354 M934.114,985.879l82.353-82.354 M1181.172,903.525
h-164.705 M1181.172,903.525l82.354-82.353 M1181.172,903.525l82.354,82.354 M1016.467,821.174l82.354-82.353 M1181.172,821.174
l-82.354-82.353 M1181.172,1068.23l82.354,82.354 M1181.172,1232.938l82.354-82.354 M1263.523,738.821l82.354,82.353
M1345.877,821.174v164.705 M1345.877,985.879l-82.354,82.354 M1345.877,985.879l82.354,82.354 M1345.877,821.174l82.354-82.353
M1263.523,1150.584h164.705 M1428.229,1150.584l82.354-82.354 M1428.229,1150.584l82.354,82.354 M1510.582,985.879l82.354,82.354
M1592.936,1068.23l82.353-82.353 M1592.936,1068.23v164.705 M1428.229,821.174l82.354,82.354 M1428.229,985.879l82.354-82.354
M1675.287,903.525h-164.705 M1675.287,903.525l82.354-82.353 M1675.287,903.525l82.354,82.354 M1510.582,821.174l82.354-82.353
M1675.287,821.174l-82.354-82.353 M1675.287,1068.23l82.354,82.354 M1675.287,1232.938l82.354-82.354 M1757.641,738.821
l82.353,82.353 M1839.992,821.174v164.705 M1839.992,985.879l-82.354,82.354 M1839.992,985.879l82.353,82.354 M1839.992,821.174
l82.353-82.353 M1757.641,1150.584h164.704 M1922.345,1150.584l82.354-82.354 M1922.345,1150.584l82.354,82.354 M2004.697,985.879
l82.353,82.354 M2087.05,1068.23l82.354-82.353 M2087.05,1068.23v164.705 M1922.345,821.174l82.354,82.354 M1922.345,985.879
l82.354-82.354 M2169.402,903.525h-164.705 M2169.402,903.525l82.353-82.353 M2169.402,903.525l82.353,82.354 M2004.697,821.174
l82.353-82.353 M2169.402,821.174l-82.354-82.353 M2169.402,1068.23l82.353,82.354 M2169.402,1232.938l82.353-82.354
M2251.755,738.821l82.353,82.353 M2334.107,821.174v164.705 M2334.107,985.879l-82.354,82.354 M2334.107,985.879l82.353,82.354
M2334.107,821.174l82.353-82.353 M2251.755,1150.584h164.705 M275.294,1232.938l82.353,82.353 M357.646,1315.289v164.705
M357.646,1479.994l-82.354,82.354 M357.646,1479.994l82.353,82.354 M357.646,1315.289l82.353-82.354 M275.294,1644.699h164.705
M439.999,1644.699l82.353-82.354 M439.999,1644.699l82.353,82.353 M522.352,1479.994l82.354,82.354 M604.704,1562.348
l82.353-82.354 M604.704,1562.348v164.704 M439.999,1315.289l82.353,82.354 M439.999,1479.994l82.353-82.354 M687.057,1397.643
H522.352 M687.057,1397.643l82.354-82.354 M769.409,1479.994l-82.353-82.354 M522.352,1315.289l82.354-82.354 M687.057,1315.289
l-82.353-82.354 M687.057,1562.348l82.354,82.353 M687.057,1727.052l82.354-82.353 M769.409,1232.938l82.353,82.353
M851.762,1315.289v164.705 M851.762,1479.994l-82.353,82.354 M851.762,1479.994l82.354,82.354 M851.762,1315.289l82.354-82.354
M769.409,1644.699h164.705 M934.114,1644.699l82.353-82.354 M934.114,1644.699l82.353,82.353 M1016.467,1479.994l82.354,82.354
M1098.818,1562.348l82.354-82.354 M1098.818,1562.348v164.704 M934.114,1315.289l82.353,82.354 M934.114,1479.994l82.353-82.354
M1181.172,1397.643h-164.705 M1181.172,1397.643l82.354-82.354 M1263.523,1479.994l-82.353-82.354 M1016.467,1315.289
l82.354-82.354 M1181.172,1315.289l-82.354-82.354 M1181.172,1562.348l82.354,82.353 M1181.172,1727.052l82.354-82.353
M1263.523,1232.938l82.354,82.353 M1345.877,1315.289v164.705 M1263.523,1562.348l82.354-82.354 M1345.877,1479.994l82.354,82.354
M1345.877,1315.289l82.354-82.354 M1263.523,1644.699h164.705 M1428.229,1644.699l82.354-82.354 M1428.229,1644.699l82.354,82.353
M1510.582,1479.994l82.354,82.354 M1592.936,1562.348l82.353-82.354 M1592.936,1562.348v164.704 M1428.229,1315.289l82.354,82.354
M1428.229,1479.994l82.354-82.354 M1675.287,1397.643h-164.705 M1675.287,1397.643l82.354-82.354 M1757.641,1479.994
l-82.354-82.354 M1510.582,1315.289l82.354-82.354 M1675.287,1315.289l-82.354-82.354 M1675.287,1562.348l82.354,82.353
M1675.287,1727.052l82.354-82.353 M1757.641,1232.938l82.353,82.353 M1839.992,1315.289v164.705 M1839.992,1479.994l-82.354,82.354
M1839.992,1479.994l82.353,82.354 M1839.992,1315.289l82.353-82.354 M1757.641,1644.699h164.704 M1922.345,1644.699l82.354-82.354
M1922.345,1644.699l82.354,82.353 M2004.697,1479.994l82.353,82.354 M2087.05,1562.348l82.354-82.354 M2087.05,1562.348v164.704
M1922.345,1315.289l82.354,82.354 M1922.345,1479.994l82.354-82.354 M2169.402,1397.643h-164.705 M2169.402,1397.643l82.353-82.354
M2251.755,1479.994l-82.353-82.354 M2004.697,1315.289l82.353-82.354 M2169.402,1315.289l-82.354-82.354 M2169.402,1562.348
l82.353,82.353 M2169.402,1727.052l82.353-82.353 M2251.755,1232.938l82.353,82.353 M2334.107,1315.289v164.705 M2334.107,1479.994
l-82.354,82.354 M2334.107,1479.994l82.353,82.354 M2334.107,1315.289l82.353-82.354 M2251.755,1644.699h164.705 M275.294,1727.052
l82.353,82.354 M357.646,1809.404v164.705 M357.646,1974.109l-82.354,82.353 M357.646,1974.109l82.353,82.353 M357.646,1809.404
l82.353-82.354 M275.294,2138.814h164.705 M439.999,2138.814l82.353-82.354 M439.999,2138.814l82.353,82.353 M522.352,1974.109
l82.354,82.353 M604.704,2056.462l82.353-82.353 M604.704,2056.462v164.705 M439.999,1809.404l82.353,82.353 M439.999,1974.109
l82.353-82.354 M687.057,1891.757H522.352 M687.057,1891.757l82.354-82.353 M687.057,1891.757l82.354,82.354 M522.352,1809.404
l82.354-82.354 M687.057,1809.404l-82.353-82.354 M687.057,2056.462l82.354,82.353 M687.057,2221.167l82.354-82.353
M769.409,1727.052l82.353,82.354 M851.762,1809.404v164.705 M851.762,1974.109l-82.353,82.353 M851.762,1974.109l82.354,82.353
M851.762,1809.404l82.354-82.354 M769.409,2138.814h164.705 M934.114,2138.814l82.353-82.354 M934.114,2138.814l82.353,82.353
M1016.467,1974.109l82.354,82.353 M1098.818,2056.462l82.354-82.353 M1098.818,2056.462v164.705 M934.114,1809.404l82.353,82.353
M934.114,1974.109l82.353-82.354 M1181.172,1891.757h-164.705 M1181.172,1891.757l82.354-82.353 M1181.172,1891.757l82.354,82.354
M1016.467,1809.404l82.354-82.354 M1181.172,1809.404l-82.354-82.354 M1181.172,2056.462l82.354,82.353 M1181.172,2221.167
l82.354-82.353 M1263.523,1727.052l82.354,82.354 M1345.877,1809.404v164.705 M1345.877,1974.109l-82.354,82.353 M1345.877,1974.109
l82.354,82.353 M1345.877,1809.404l82.354-82.354 M1263.523,2138.814h164.705 M1428.229,2138.814l82.354-82.354 M1428.229,2138.814
l82.354,82.353 M1510.582,1974.109l82.354,82.353 M1592.936,2056.462l82.353-82.353 M1592.936,2056.462v164.705 M1428.229,1809.404
l82.354,82.353 M1428.229,1974.109l82.354-82.354 M1675.287,1891.757h-164.705 M1675.287,1891.757l82.354-82.353 M1675.287,1891.757
l82.354,82.354 M1510.582,1809.404l82.354-82.354 M1675.287,1809.404l-82.354-82.354 M1675.287,2056.462l82.354,82.353
M1675.287,2221.167l82.354-82.353 M1757.641,1727.052l82.353,82.354 M1839.992,1809.404v164.705 M1839.992,1974.109l-82.354,82.353
M1839.992,1974.109l82.353,82.353 M1839.992,1809.404l82.353-82.354 M1757.641,2138.814h164.704 M1922.345,2138.814l82.354-82.354
M1922.345,2138.814l82.354,82.353 M2004.697,1974.109l82.353,82.353 M2087.05,2056.462l82.354-82.353 M2087.05,2056.462v164.705
M1922.345,1809.404l82.354,82.353 M1922.345,1974.109l82.354-82.354 M2169.402,1891.757h-164.705 M2169.402,1891.757l82.353-82.353
M2169.402,1891.757l82.353,82.354 M2004.697,1809.404l82.353-82.354 M2169.402,1809.404l-82.354-82.354 M2169.402,2056.462
l82.353,82.353 M2169.402,2221.167l82.353-82.353 M2251.755,1727.052l82.353,82.354 M2334.107,1809.404v164.705 M2334.107,1974.109
l-82.354,82.353 M2334.107,1974.109l82.353,82.353 M2334.107,1809.404l82.353-82.354 M2251.755,2138.814h164.705 M275.294,2221.167
l82.353,82.353 M357.646,2303.52v164.705 M357.646,2303.52l82.353-82.353 M439.999,2303.52l82.353,82.354 M439.999,2468.225
l82.353-82.353 M687.057,2385.872H522.352 M687.057,2385.872l82.354-82.353 M687.057,2385.872l82.354,82.353 M522.352,2303.52
l82.354-82.353 M687.057,2303.52l-82.353-82.353 M769.409,2221.167l82.353,82.353 M851.762,2303.52v164.705 M851.762,2303.52
l82.354-82.353 M934.114,2303.52l82.353,82.354 M934.114,2468.225l82.353-82.353 M1181.172,2385.872h-164.705 M1181.172,2385.872
l82.354-82.353 M1181.172,2385.872l82.354,82.353 M1016.467,2303.52l82.354-82.353 M1181.172,2303.52l-82.354-82.353
M1263.523,2221.167l82.354,82.353 M1345.877,2303.52v164.705 M1345.877,2303.52l82.354-82.353 M1428.229,2303.52l82.354,82.354
M1428.229,2468.225l82.354-82.353 M1675.287,2385.872h-164.705 M1675.287,2385.872l82.354-82.353 M1675.287,2385.872l82.354,82.353
M1510.582,2303.52l82.354-82.353 M1675.287,2303.52l-82.354-82.353 M1757.641,2221.167l82.353,82.353 M1839.992,2303.52v164.705
M1839.992,2303.52l82.353-82.353 M1922.345,2303.52l82.354,82.354 M1922.345,2468.225l82.354-82.353 M2169.402,2385.872h-164.705
M2169.402,2385.872l82.353-82.353 M2169.402,2385.872l82.353,82.353 M2004.697,2303.52l82.353-82.353 M2169.402,2303.52
l-82.354-82.353 M2251.755,2221.167l82.353,82.353 M2334.107,2303.52v164.705 M2334.107,2303.52l82.353-82.353"
/>
</svg>
assets/Tessellations/huffmanRectangularWeave.svg
0 → 100644
View file @
2cc2160b
This diff is collapsed.
Click to expand it.
assets/Tessellations/huffmanStarsTriangles.svg
0 → 100755
View file @
2cc2160b
This diff is collapsed.
Click to expand it.
assets/Tessellations/
w
aterbomb
Twist
.svg
→
assets/Tessellations/
huffmanW
aterbomb.svg
View file @
2cc2160b
File moved
assets/Tessellations/
h
oneycomb
_333_cp
.svg
→
assets/Tessellations/
langH
oneycomb.svg
View file @
2cc2160b
File moved
assets/Tessellations/reschbarbell.svg
deleted
100755 → 0
View file @
e94f9a8a
This diff is collapsed.
Click to expand it.
index.html
View file @
2cc2160b
...
...
@@ -568,6 +568,7 @@
<a
tabindex=
"-1"
>
Origami
<span
class=
"pull-right fui-arrow-right"
></span></a>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"#"
class=
"demo"
data-url=
"Origami/randlettflappingbird.svg"
>
Randlett Flapping Bird
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Origami/hypar.svg"
>
Hypar
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Origami/singlesquaretwist.svg"
>
Square Twist (single)
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Origami/squaretwistManyAngles.svg"
>
Square Twist (many angles)
</a></li>
</ul>
...
...
@@ -576,11 +577,16 @@
<a
tabindex=
"-1"
>
Tesselations
<span
class=
"pull-right fui-arrow-right"
></span></a>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/miura-ori.svg"
>
Miura-Ori
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/waterbomb.svg"
>
Waterbomb (six-crease base)
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/waterbombTwist.svg"
>
Waterbomb (eight-crease base)
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/reschtritessellation.svg"
>
Resch Triangle Tessellation
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/reschbarbell.svg"
>
Resch Barbell Tessellation
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/honeycomb_333_cp.svg"
>
Lang Honeycomb Tessellation
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/waterbomb.svg"
>
Waterbomb
</a></li>
<li
class=
"divider"
></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/huffmanExtrudedBoxes.svg"
>
Huffman Extruded Boxes
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/huffmanWaterbomb.svg"
>
Huffman Waterbombs
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/huffmanRectangularWeave.svg"
>
Huffman Rect Weave
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/huffmanStarsTriangles.svg"
>
Huffman Stars-Triangles
</a></li>
<li
class=
"divider"
></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/reschTriTessellation.svg"
>
Resch Triangle Tessellation
</a></li>
<li
class=
"divider"
></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/langHoneycomb.svg"
>
Lang Honeycomb Tessellation
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/oval_tessellation_cp.svg"
>
Lang Oval Tessellation
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/hyperbolic_limit_cp.svg"
>
Lang Hyperbolic Limit
</a></li>
</ul>
...
...
@@ -595,7 +601,6 @@
<li
class=
"dropdown-submenu"
>
<a
tabindex=
"-1"
>
Problematic Patterns
<span
class=
"pull-right fui-arrow-right"
></span></a>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"#"
class=
"demo"
data-url=
"Origami/hypar.svg"
>
Hypar
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/wedged_double_faced.svg"
>
Lang Wedged Double Faced Tessellation
</a></li>
<li><a
href=
"#"
class=
"demo"
data-url=
"Tessellations/rattanweaveLang.svg"
>
Lang Rattan Weave
</a></li>
</ul>
...
...
js/main.js
View file @
2cc2160b
...
...
@@ -19,5 +19,5 @@ $(function() {
globals
.
rigidSolver
=
initRigidSolver
(
globals
);
globals
.
pattern
=
initPattern
(
globals
);
globals
.
vive
=
initViveInterface
(
globals
);
$
(
"
.demo[data-url='Tessellations/
h
oneycomb
_333_cp
.svg']
"
).
click
();
//load demo models
$
(
"
.demo[data-url='Tessellations/
langH
oneycomb.svg']
"
).
click
();
//load demo models
});
\ No newline at end of file
js/saveSTL.js
View file @
2cc2160b
...
...
@@ -21,20 +21,24 @@ function makeSaveGEO(doublesided){
geo
.
computeFaceNormals
();
for
(
var
i
=
0
;
i
<
numVertices
;
i
++
){
var
face
;
var
vertexNormal
=
null
;
var
vertexNormal
=
new
THREE
.
Vector3
();
var
lastFaceIndex
=
0
;
for
(
var
j
=
0
;
j
<
geo
.
faces
.
length
;
j
++
){
face
=
geo
.
faces
[
j
];
if
(
face
.
a
==
i
)
vertexNormal
=
face
.
vertexNormals
[
0
];
if
(
face
.
b
==
i
)
vertexNormal
=
face
.
vertexNormals
[
1
];
if
(
face
.
c
==
i
)
vertexNormal
=
face
.
vertexNormals
[
2
];
if
(
vertexNormal
!==
null
)
break
;
if
(
face
.
a
==
i
||
face
.
b
==
i
||
face
.
c
==
i
)
{
vertexNormal
.
add
(
face
.
normal
);
lastFaceIndex
=
j
;
}
// if (vertexNormal !== null) break;
}
if
(
vertexNormal
===
undefined
)
{
geo
.
vertices
.
push
(
new
THREE
.
Vector3
());
continue
;
}
var
offset
=
vertexNormal
.
clone
().
multiplyScalar
(
globals
.
thickenOffset
/
(
2
*
vertexNormal
.
dot
(
face
.
normal
)));
console
.
log
(
offset
.
length
());
// if (vertexNormal === undefined) {
// geo.vertices.push(new THREE.Vector3());
// continue;
// }
vertexNormal
.
normalize
();
console
.
log
(
vertexNormal
);
var
offset
=
vertexNormal
.
clone
().
multiplyScalar
(
globals
.
thickenOffset
/
(
2
*
vertexNormal
.
clone
().
dot
(
geo
.
faces
[
lastFaceIndex
].
normal
)));
geo
.
vertices
.
push
(
geo
.
vertices
[
i
].
clone
().
sub
(
offset
));
geo
.
vertices
[
i
].
add
(
offset
);
}
...
...
Write
Preview
Markdown
is supported
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