Optimization: std::vector<bool> can be quite slow to access
This commit is contained in:
parent
fe3a15942b
commit
85ad56b43b
3 changed files with 3 additions and 3 deletions
|
@ -622,7 +622,7 @@ std::vector<Vec3i> its_face_edge_ids(const indexed_triangle_set &its, std::funct
|
||||||
return its_face_edge_ids_impl(its, [](const uint32_t){ return true; }, throw_on_cancel_callback);
|
return its_face_edge_ids_impl(its, [](const uint32_t){ return true; }, throw_on_cancel_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Vec3i> its_face_edge_ids(const indexed_triangle_set &its, const std::vector<bool> &face_mask)
|
std::vector<Vec3i> its_face_edge_ids(const indexed_triangle_set &its, const std::vector<char> &face_mask)
|
||||||
{
|
{
|
||||||
return its_face_edge_ids_impl(its, [&face_mask](const uint32_t idx){ return face_mask[idx]; }, [](){});
|
return its_face_edge_ids_impl(its, [&face_mask](const uint32_t idx){ return face_mask[idx]; }, [](){});
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,7 +188,7 @@ private:
|
||||||
// Used for chaining slice lines into polygons.
|
// Used for chaining slice lines into polygons.
|
||||||
std::vector<Vec3i> its_face_edge_ids(const indexed_triangle_set &its);
|
std::vector<Vec3i> its_face_edge_ids(const indexed_triangle_set &its);
|
||||||
std::vector<Vec3i> its_face_edge_ids(const indexed_triangle_set &its, std::function<void()> throw_on_cancel_callback);
|
std::vector<Vec3i> its_face_edge_ids(const indexed_triangle_set &its, std::function<void()> throw_on_cancel_callback);
|
||||||
std::vector<Vec3i> its_face_edge_ids(const indexed_triangle_set &its, const std::vector<bool> &face_mask);
|
std::vector<Vec3i> its_face_edge_ids(const indexed_triangle_set &its, const std::vector<char> &face_mask);
|
||||||
// Having the face neighbors available, assign unique edge IDs to face edges for chaining of polygons over slices.
|
// Having the face neighbors available, assign unique edge IDs to face edges for chaining of polygons over slices.
|
||||||
std::vector<Vec3i> its_face_edge_ids(const indexed_triangle_set &its, std::vector<Vec3i> &face_neighbors, bool assign_unbound_edges = false, int *num_edges = nullptr);
|
std::vector<Vec3i> its_face_edge_ids(const indexed_triangle_set &its, std::vector<Vec3i> &face_neighbors, bool assign_unbound_edges = false, int *num_edges = nullptr);
|
||||||
|
|
||||||
|
|
|
@ -1805,7 +1805,7 @@ Polygons slice_mesh(
|
||||||
{
|
{
|
||||||
bool trafo_identity = is_identity(params.trafo);
|
bool trafo_identity = is_identity(params.trafo);
|
||||||
Transform3f tf;
|
Transform3f tf;
|
||||||
std::vector<bool> face_mask(mesh.indices.size(), false);
|
std::vector<char> face_mask(mesh.indices.size(), 0);
|
||||||
|
|
||||||
{
|
{
|
||||||
// 1) Mark vertices as below or above the slicing plane.
|
// 1) Mark vertices as below or above the slicing plane.
|
||||||
|
|
Loading…
Reference in a new issue