diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index 1d80f6995..3b1bd5df2 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -874,28 +874,15 @@ const BoundingBoxf3& ModelObject::raw_bounding_box() const if (! m_raw_bounding_box_valid) { m_raw_bounding_box_valid = true; m_raw_bounding_box.reset(); - #if ENABLE_GENERIC_SUBPARTS_PLACEMENT if (this->instances.empty()) throw std::invalid_argument("Can't call raw_bounding_box() with no instances"); const Transform3d& inst_matrix = this->instances.front()->get_transformation().get_matrix(true); - #endif // ENABLE_GENERIC_SUBPARTS_PLACEMENT for (const ModelVolume *v : this->volumes) - if (v->is_model_part()) { - #if !ENABLE_GENERIC_SUBPARTS_PLACEMENT - if (this->instances.empty()) - throw std::invalid_argument("Can't call raw_bounding_box() with no instances"); - #endif // !ENABLE_GENERIC_SUBPARTS_PLACEMENT - - #if ENABLE_GENERIC_SUBPARTS_PLACEMENT - m_raw_bounding_box.merge(v->mesh.transformed_bounding_box(inst_matrix * v->get_matrix())); - #else - // unmaintaned - assert(false); - // vol_mesh.transform(v->get_matrix()); - // m_raw_bounding_box_valid.merge(this->instances.front()->transform_mesh_bounding_box(vol_mesh, true)); - #endif // ENABLE_GENERIC_SUBPARTS_PLACEMENT - } + { + if (v->is_model_part()) + m_raw_bounding_box.merge(v->mesh.transformed_bounding_box(inst_matrix * v->get_matrix())); + } } return m_raw_bounding_box; } @@ -904,22 +891,11 @@ const BoundingBoxf3& ModelObject::raw_bounding_box() const BoundingBoxf3 ModelObject::instance_bounding_box(size_t instance_idx, bool dont_translate) const { BoundingBoxf3 bb; -#if ENABLE_GENERIC_SUBPARTS_PLACEMENT const Transform3d& inst_matrix = this->instances[instance_idx]->get_transformation().get_matrix(dont_translate); -#endif // ENABLE_GENERIC_SUBPARTS_PLACEMENT for (ModelVolume *v : this->volumes) { if (v->is_model_part()) - { -#if ENABLE_GENERIC_SUBPARTS_PLACEMENT bb.merge(v->mesh.transformed_bounding_box(inst_matrix * v->get_matrix())); -#else - // not maintained - assert(false); - //mesh.transform(v->get_matrix()); - //bb.merge(this->instances[instance_idx]->transform_mesh_bounding_box(mesh, dont_translate)); -#endif // ENABLE_GENERIC_SUBPARTS_PLACEMENT - } } return bb; } diff --git a/src/libslic3r/Technologies.hpp b/src/libslic3r/Technologies.hpp index 6dc560465..7e1f14334 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -35,8 +35,6 @@ // Changed algorithm to extract euler angles from rotation matrix #define ENABLE_NEW_EULER_ANGLES (1 && ENABLE_1_42_0_ALPHA4) -// Modified initial default placement of generic subparts -#define ENABLE_GENERIC_SUBPARTS_PLACEMENT (1 && ENABLE_1_42_0_ALPHA4) //==================== diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 7081c1e13..5a837f14d 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -1579,11 +1579,6 @@ void ObjectList::load_generic_subobject(const std::string& type_name, const Mode ModelVolume *new_volume = model_object.add_volume(std::move(mesh)); new_volume->set_type(type); -#if !ENABLE_GENERIC_SUBPARTS_PLACEMENT - new_volume->set_offset(Vec3d(0.0, 0.0, model_object.origin_translation(2) - mesh.stl.stats.min(2))); -#endif // !ENABLE_GENERIC_SUBPARTS_PLACEMENT - -#if ENABLE_GENERIC_SUBPARTS_PLACEMENT if (instance_idx != -1) { // First (any) GLVolume of the selected instance. They all share the same instance matrix. @@ -1599,7 +1594,6 @@ void ObjectList::load_generic_subobject(const std::string& type_name, const Mode Vec3d(instance_bb.max(0), instance_bb.min(1), instance_bb.min(2)) + 0.5 * mesh_bb.size() - v->get_instance_offset(); new_volume->set_offset(v->get_instance_transformation().get_matrix(true).inverse() * offset); } -#endif // ENABLE_GENERIC_SUBPARTS_PLACEMENT new_volume->name = into_u8(name); // set a default extruder value, since user can't add it manually