diff --git a/src/admesh/stl.h b/src/admesh/stl.h index 9898f3e64..45889bcd3 100644 --- a/src/admesh/stl.h +++ b/src/admesh/stl.h @@ -173,7 +173,7 @@ extern void stl_mirror_xy(stl_file *stl); extern void stl_mirror_yz(stl_file *stl); extern void stl_mirror_xz(stl_file *stl); extern void stl_transform(stl_file *stl, float *trafo3x4); -extern void stl_transform(stl_file *stl, const Eigen::Transform& t); +extern void stl_transform(stl_file *stl, const Eigen::Transform& t); extern void stl_open_merge(stl_file *stl, char *file); extern void stl_invalidate_shared_vertices(stl_file *stl); extern void stl_generate_shared_vertices(stl_file *stl); diff --git a/src/admesh/util.cpp b/src/admesh/util.cpp index cc104fdd1..7cb69bccd 100644 --- a/src/admesh/util.cpp +++ b/src/admesh/util.cpp @@ -155,7 +155,7 @@ void stl_transform(stl_file *stl, float *trafo3x4) { calculate_normals(stl); } -void stl_transform(stl_file *stl, const Eigen::Transform& t) +void stl_transform(stl_file *stl, const Eigen::Transform& t) { if (stl->error) return; @@ -178,7 +178,7 @@ void stl_transform(stl_file *stl, const Eigen::Transform() * src_vertices.colwise().homogeneous(); facet_ptr = stl->facet_start; v_id = 0; diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index 577d16c3c..fabc2992d 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -627,7 +627,7 @@ const BoundingBoxf3& ModelObject::bounding_box() const #if ENABLE_MODELVOLUME_TRANSFORM { TriangleMesh m = v->mesh; - m.transform(v->get_matrix().cast()); + m.transform(v->get_matrix()); raw_bbox.merge(m.bounding_box()); } #else @@ -667,7 +667,7 @@ TriangleMesh ModelObject::raw_mesh() const #if ENABLE_MODELVOLUME_TRANSFORM { TriangleMesh vol_mesh(v->mesh); - vol_mesh.transform(v->get_matrix().cast()); + vol_mesh.transform(v->get_matrix()); mesh.merge(vol_mesh); } #else @@ -1212,14 +1212,14 @@ void ModelInstance::set_mirror(Axis axis, double mirror) void ModelInstance::transform_mesh(TriangleMesh* mesh, bool dont_translate) const { - mesh->transform(get_matrix(dont_translate).cast()); + mesh->transform(get_matrix(dont_translate)); } BoundingBoxf3 ModelInstance::transform_mesh_bounding_box(const TriangleMesh* mesh, bool dont_translate) const { // Rotate around mesh origin. TriangleMesh copy(*mesh); - copy.transform(get_matrix(true, false, true, true).cast()); + copy.transform(get_matrix(true, false, true, true)); BoundingBoxf3 bbox = copy.bounding_box(); if (!empty(bbox)) { diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 9ae654cbc..447ba076a 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1604,14 +1604,14 @@ std::vector PrintObject::_slice_volumes(const std::vector &z, #if ENABLE_MODELVOLUME_TRANSFORM { TriangleMesh vol_mesh(v->mesh); - vol_mesh.transform(v->get_matrix().cast()); + vol_mesh.transform(v->get_matrix()); mesh.merge(vol_mesh); } #else mesh.merge(v->mesh); #endif // ENABLE_MODELVOLUME_TRANSFORM if (mesh.stl.stats.number_of_facets > 0) { - mesh.transform(m_trafo.cast()); + mesh.transform(m_trafo); // apply XY shift mesh.translate(- unscale(m_copies_shift(0)), - unscale(m_copies_shift(1)), 0); // perform actual slicing diff --git a/src/libslic3r/TriangleMesh.cpp b/src/libslic3r/TriangleMesh.cpp index c8a6e2130..425967f9f 100644 --- a/src/libslic3r/TriangleMesh.cpp +++ b/src/libslic3r/TriangleMesh.cpp @@ -272,9 +272,9 @@ void TriangleMesh::rotate(float angle, const Vec3d& axis) if (angle == 0.f) return; - Vec3f axis_norm = axis.cast().normalized(); - Transform3f m = Transform3f::Identity(); - m.rotate(Eigen::AngleAxisf(angle, axis_norm)); + Vec3d axis_norm = axis.normalized(); + Transform3d m = Transform3d::Identity(); + m.rotate(Eigen::AngleAxisd(angle, axis_norm)); stl_transform(&stl, m); } @@ -290,7 +290,7 @@ void TriangleMesh::mirror(const Axis &axis) stl_invalidate_shared_vertices(&this->stl); } -void TriangleMesh::transform(const Transform3f& t) +void TriangleMesh::transform(const Transform3d& t) { stl_transform(&stl, t); } diff --git a/src/libslic3r/TriangleMesh.hpp b/src/libslic3r/TriangleMesh.hpp index f6e0baea9..fd312d0e0 100644 --- a/src/libslic3r/TriangleMesh.hpp +++ b/src/libslic3r/TriangleMesh.hpp @@ -49,7 +49,7 @@ public: void mirror_x() { this->mirror(X); } void mirror_y() { this->mirror(Y); } void mirror_z() { this->mirror(Z); } - void transform(const Transform3f& t); + void transform(const Transform3d& t); void align_to_origin(); void rotate(double angle, Point* center); TriangleMeshPtrs split() const; diff --git a/src/slic3r/GUI/GLGizmo.cpp b/src/slic3r/GUI/GLGizmo.cpp index d632f0d91..974f855e2 100644 --- a/src/slic3r/GUI/GLGizmo.cpp +++ b/src/slic3r/GUI/GLGizmo.cpp @@ -1256,7 +1256,7 @@ void GLGizmoFlatten::update_planes() #if ENABLE_MODELVOLUME_TRANSFORM { TriangleMesh vol_ch = vol->get_convex_hull(); - vol_ch.transform(vol->get_matrix().cast()); + vol_ch.transform(vol->get_matrix()); ch.merge(vol_ch); } #else