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
OpenMesh
OpenMesh
Commits
74ada2ea
Commit
74ada2ea
authored
Nov 07, 2016
by
Jan Möbius
Browse files
Warning
parent
7bcc3ec1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/OpenMesh/Tools/Subdivider/Uniform/ModifiedButterFlyT.hh
View file @
74ada2ea
...
...
@@ -150,14 +150,14 @@ public:
{
weights
[
K
].
resize
(
K
+
1
);
// s(j) = ( 1/4 + cos(2*pi*j/K) + 1/2 * cos(4*pi*j/K) )/K
real_t
invK
=
static_cast
<
real_t
>
(
1.0
)
/
real_t
(
K
);
double
invK
=
1.0
/
static_cast
<
double
>
(
K
);
real_t
sum
=
0
;
for
(
unsigned
int
j
=
0
;
j
<
K
;
++
j
)
{
weights
[
K
][
j
]
=
(
0.25
+
cos
(
2.0
*
M_PI
*
j
*
invK
)
+
0.5
*
cos
(
4.0
*
M_PI
*
j
*
invK
))
*
invK
;
weights
[
K
][
j
]
=
static_cast
<
real_t
>
(
(
0.25
+
cos
(
2.0
*
M_PI
*
static_cast
<
double
>
(
j
)
*
invK
)
+
0.5
*
cos
(
4.0
*
M_PI
*
static_cast
<
double
>
(
j
)
*
invK
))
*
invK
)
;
sum
+=
weights
[
K
][
j
];
}
weights
[
K
][
K
]
=
(
real_t
)
1.0
-
sum
;
weights
[
K
][
K
]
=
static_cast
<
real_t
>
(
1.0
)
-
sum
;
}
}
...
...
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