Skip to content
Snippets Groups Projects
Commit 4edddb1b authored by Tom Fischer's avatar Tom Fischer
Browse files

[GL] Use Eigen::Vector3d instead of std::array.

Using Eigen::Vector3d allows some nice shortening
of the code.
parent 488881f7
No related branches found
No related tags found
No related merge requests found
......@@ -38,9 +38,7 @@ SurfaceGrid::SurfaceGrid(Surface const* const sfc)
}
}
std::array<double, 3> delta{{max_point[0] - min_point[0],
max_point[1] - min_point[1],
max_point[2] - min_point[2]}};
Eigen::Vector3d delta = max_point - min_point;
if (delta[0] < std::numeric_limits<double>::epsilon())
{
......@@ -72,14 +70,8 @@ SurfaceGrid::SurfaceGrid(Surface const* const sfc)
const std::size_t n_tris(sfc->getNumberOfTriangles());
const std::size_t n_tris_per_cell(5);
std::bitset<3> dim; // all bits are set to zero.
for (std::size_t k(0); k < 3; ++k)
{
if (delta[k] >= std::numeric_limits<double>::epsilon())
{
dim[k] = true;
}
}
Eigen::Matrix<bool, 3, 1> dim =
delta.array() >= std::numeric_limits<double>::epsilon();
// *** condition: n_tris / n_cells < n_tris_per_cell
// where n_cells = _n_steps[0] * _n_steps[1] * _n_steps[2]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment