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
Jonas Plewinski
waLBerla
Commits
c6cf5b99
Commit
c6cf5b99
authored
May 03, 2022
by
Christoph Rettinger
Browse files
Added missing calls to compute mesh face normals in mesa_pd convex polyhedron
parent
27988dd7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/mesa_pd/common/Contains.h
View file @
c6cf5b99
...
...
@@ -79,6 +79,8 @@ bool isPointInsideCylindricalBoundary(const Vec3& point,
#ifdef WALBERLA_MESAPD_CONVEX_POLYHEDRON_AVAILABLE
bool
isPointInsideConvexPolyhedronBF
(
const
Vec3
&
point
,
const
mesh
::
TriangleMesh
&
mesh
)
{
WALBERLA_ASSERT
(
mesh
.
has_face_normals
(),
"Provided mesh has no face normals! E.g., call `mesh.request_face_normals(); mesh.update_face_normals();` to add them."
)
return
std
::
none_of
(
mesh
.
faces
().
begin
(),
mesh
.
faces
().
end
(),
[
&
](
auto
fh
)
...
...
src/mesa_pd/data/shape/ConvexPolyhedron.h
View file @
c6cf5b99
...
...
@@ -130,6 +130,9 @@ inline void ConvexPolyhedron::updateMassAndInertia(const real_t density) {
inline
void
ConvexPolyhedron
::
updateMeshQuantities
()
{
WALBERLA_CHECK_GREATER
(
mesh_
.
n_vertices
(),
0
,
"Cannot compute mesh quantities for an empty mesh!"
);
mesh_
.
request_face_normals
();
mesh_
.
update_face_normals
();
octandVertices_
[
0
]
=
supportVertex
(
mesh
::
TriangleMesh
::
Normal
(
real_t
(
1
),
real_t
(
1
),
real_t
(
1
)),
*
mesh_
.
vertices_begin
());
octandVertices_
[
1
]
=
supportVertex
(
mesh
::
TriangleMesh
::
Normal
(
real_t
(
1
),
real_t
(
1
),
real_t
(
-
1
)),
*
mesh_
.
vertices_begin
());
octandVertices_
[
2
]
=
supportVertex
(
mesh
::
TriangleMesh
::
Normal
(
real_t
(
1
),
real_t
(
-
1
),
real_t
(
1
)),
*
mesh_
.
vertices_begin
());
...
...
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