Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Philip Trettner
polymesh
Commits
7679582c
Commit
7679582c
authored
Oct 12, 2020
by
Philip Trettner
Browse files
Merge branch 'bugfix/dodecahedron-unitlength' into 'develop'
Fixed unit length See merge request
!29
parents
eac274e2
d3772f96
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/polymesh/objects/dodecahedron.cc
View file @
7679582c
...
...
@@ -6,21 +6,24 @@ polymesh::unique_array<polymesh::detail::pos3f> polymesh::detail::add_unit_dodec
{
polymesh
::
unique_array
<
pos3f
>
position
(
20
);
auto
const
phi
=
(
1
+
std
::
sqrt
(
5.0
f
))
/
2.0
f
;
auto
const
phi_inv
=
1
/
phi
;
auto
phi
=
(
1
+
std
::
sqrt
(
5.0
f
))
/
2.0
f
;
auto
phi_inv
=
1
/
phi
;
auto
const
sqrt3inv
=
1
/
std
::
sqrt
(
3.0
f
);
phi
*=
sqrt3inv
;
phi_inv
*=
sqrt3inv
;
pm
::
vertex_handle
vs
[
20
];
for
(
size_t
i
=
0
;
i
<
20
;
++
i
)
vs
[
i
]
=
m
.
vertices
().
add
();
position
[
0
]
=
{
1
,
1
,
1
};
position
[
1
]
=
{
1
,
1
,
-
1
};
position
[
2
]
=
{
1
,
-
1
,
1
};
position
[
3
]
=
{
1
,
-
1
,
-
1
};
position
[
4
]
=
{
-
1
,
1
,
1
};
position
[
5
]
=
{
-
1
,
1
,
-
1
};
position
[
6
]
=
{
-
1
,
-
1
,
1
};
position
[
7
]
=
{
-
1
,
-
1
,
-
1
};
position
[
0
]
=
{
sqrt3inv
,
sqrt3inv
,
sqrt3inv
};
position
[
1
]
=
{
sqrt3inv
,
sqrt3inv
,
-
sqrt3inv
};
position
[
2
]
=
{
sqrt3inv
,
-
sqrt3inv
,
sqrt3inv
};
position
[
3
]
=
{
sqrt3inv
,
-
sqrt3inv
,
-
sqrt3inv
};
position
[
4
]
=
{
-
sqrt3inv
,
sqrt3inv
,
sqrt3inv
};
position
[
5
]
=
{
-
sqrt3inv
,
sqrt3inv
,
-
sqrt3inv
};
position
[
6
]
=
{
-
sqrt3inv
,
-
sqrt3inv
,
sqrt3inv
};
position
[
7
]
=
{
-
sqrt3inv
,
-
sqrt3inv
,
-
sqrt3inv
};
position
[
8
]
=
{
0
,
phi
,
phi_inv
};
position
[
9
]
=
{
0
,
phi
,
-
phi_inv
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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