From 533e1feac30d751cc84217b354c4126c3af70065 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 25 Jan 2019 12:58:55 +0100 Subject: [PATCH] Fixed import of volumes from .amf --- src/libslic3r/Format/AMF.cpp | 1 + src/libslic3r/Geometry.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/Format/AMF.cpp b/src/libslic3r/Format/AMF.cpp index 80b5d5c2d..9791b1502 100644 --- a/src/libslic3r/Format/AMF.cpp +++ b/src/libslic3r/Format/AMF.cpp @@ -528,6 +528,7 @@ void AMFParserContext::endElement(const char * /* name */) } stl_get_size(&stl); m_volume->mesh.repair(); + m_volume->center_geometry(); m_volume->calculate_convex_hull(); m_volume_facets.clear(); m_volume = nullptr; diff --git a/src/libslic3r/Geometry.cpp b/src/libslic3r/Geometry.cpp index 2d8ff3284..b84e2f13d 100644 --- a/src/libslic3r/Geometry.cpp +++ b/src/libslic3r/Geometry.cpp @@ -1217,7 +1217,7 @@ Vec3d extract_euler_angles(const Eigen::Matrix& // The following euristic is the best found up to now (in the sense that it works fine with the greatest number of edge use-cases) // but there are other use-cases were it does not - // We need to imrove it + // We need to improve it double min_1 = angles1.cwiseAbs().minCoeff(); double min_2 = angles2.cwiseAbs().minCoeff(); bool use_1 = (min_1 < min_2) || (is_approx(min_1, min_2) && (angles1.norm() <= angles2.norm()));