Fixed FFF slicing of meshes with left hand oriented transformations applied.

Slight optimization of FFF slicing - optimized copy of an object with just
a single volume.
This commit is contained in:
bubnikv 2019-04-03 11:12:03 +02:00
parent eeae1c0495
commit 382326ffc8
3 changed files with 16 additions and 10 deletions

View file

@ -314,10 +314,15 @@ void TriangleMesh::mirror(const Axis &axis)
stl_invalidate_shared_vertices(&this->stl);
}
void TriangleMesh::transform(const Transform3d& t)
void TriangleMesh::transform(const Transform3d& t, bool fix_left_handed)
{
stl_transform(&stl, t);
stl_invalidate_shared_vertices(&stl);
if (fix_left_handed && t.matrix().block(0, 0, 3, 3).determinant() < 0.) {
// Left handed transformation is being applied. It is a good idea to flip the faces and their normals.
this->repair();
stl_reverse_all_facets(&stl);
}
}
void TriangleMesh::align_to_origin()