Tiny optimization of slice_mesh_slabs() with mirrored objects.
This commit is contained in:
parent
79eb59b9f2
commit
00c444f8c8
@ -1919,7 +1919,7 @@ void slice_mesh_slabs(
|
||||
#endif // EXPENSIVE_DEBUG_CHECKS
|
||||
|
||||
std::vector<stl_vertex> vertices_transformed = transform_mesh_vertices_for_slicing(mesh, trafo);
|
||||
const bool mirrored = trafo.matrix().determinant() < 0;
|
||||
const auto mirrored_sign = int64_t(trafo.matrix().block(0, 0, 3, 3).determinant() < 0 ? -1 : 1);
|
||||
|
||||
std::vector<FaceOrientation> face_orientation(mesh.indices.size(), FaceOrientation::Up);
|
||||
for (const stl_triangle_vertex_indices &tri : mesh.indices) {
|
||||
@ -1930,7 +1930,7 @@ void slice_mesh_slabs(
|
||||
const Point a = to_2d(fa).cast<coord_t>();
|
||||
const Point b = to_2d(fb).cast<coord_t>();
|
||||
const Point c = to_2d(fc).cast<coord_t>();
|
||||
const int64_t d = cross2((b - a).cast<int64_t>(), (c - b).cast<int64_t>()) * (mirrored ? -1 : 1);
|
||||
const int64_t d = cross2((b - a).cast<int64_t>(), (c - b).cast<int64_t>()) * mirrored_sign;
|
||||
FaceOrientation fo = FaceOrientation::Vertical;
|
||||
if (d > 0)
|
||||
fo = FaceOrientation::Up;
|
||||
|
Loading…
Reference in New Issue
Block a user