Skip to content

Commit

Permalink
Fix uninitialized ball.planar value
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcars committed Aug 10, 2023
1 parent 1f611a9 commit 51a930d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions palace/utils/geodata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,13 +792,14 @@ BoundingBall BoundingBallFromPointCloud(MPI_Comm comm,
});

constexpr double planar_tolerance = 1e-9;
if (PerpendicularDistance({delta, n_radial}, out_of_plane) > planar_tolerance)

ball.planar = PerpendicularDistance({delta, n_radial}, out_of_plane) < planar_tolerance;
if (!ball.planar)
{
// The points are not functionally coplanar, zero out the normal.
Vector3dMap(ball.planar_normal.data()) *= 0;
MFEM_VERIFY(PerpendicularDistance({delta, n_radial}, out_of_plane) <= ball.radius,
"A point perpendicular must be contained in the ball");
ball.planar = true;
}
}

Expand Down

0 comments on commit 51a930d

Please sign in to comment.