diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index 9ea69ae6a..aad94ee3c 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -1004,6 +1004,11 @@ const TriangleMesh& ModelVolume::get_convex_hull() const return m_convex_hull; } +TriangleMesh& ModelVolume::get_convex_hull() +{ + return m_convex_hull; +} + ModelVolume::Type ModelVolume::type_from_string(const std::string &s) { // Legacy support diff --git a/src/libslic3r/Model.hpp b/src/libslic3r/Model.hpp index e2405fc83..d9abc109a 100644 --- a/src/libslic3r/Model.hpp +++ b/src/libslic3r/Model.hpp @@ -198,6 +198,7 @@ public: void calculate_convex_hull(); const TriangleMesh& get_convex_hull() const; + TriangleMesh& get_convex_hull(); // Helpers for loading / storing into AMF / 3MF files. static Type type_from_string(const std::string &s); diff --git a/src/slic3r/GUI/GUI_ObjectParts.cpp b/src/slic3r/GUI/GUI_ObjectParts.cpp index d27494617..23bc3bd17 100644 --- a/src/slic3r/GUI/GUI_ObjectParts.cpp +++ b/src/slic3r/GUI/GUI_ObjectParts.cpp @@ -1236,7 +1236,10 @@ void load_part( ModelObject* model_object, part_names.Add(new_volume->name); if (delta != Vec3d::Zero()) + { new_volume->mesh.translate((float)delta(0), (float)delta(1), (float)delta(2)); + new_volume->get_convex_hull().translate((float)delta(0), (float)delta(1), (float)delta(2)); + } // set a default extruder value, since user can't add it manually new_volume->config.set_key_value("extruder", new ConfigOptionInt(0));