From 3b2b5a43d523170db2b16ca7027b87b34a5b8832 Mon Sep 17 00:00:00 2001 From: supermerill Date: Mon, 6 Dec 2021 10:36:41 +0100 Subject: [PATCH] auto-center now ignore unprintable objects supermerill/SuperSlicer#2008 --- src/libslic3r/Model.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index 6d460d524..d86e88e48 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -369,8 +369,10 @@ bool Model::center_instances_around_point(const Vec2d &point) { BoundingBoxf3 bb; for (ModelObject *o : this->objects) - for (size_t i = 0; i < o->instances.size(); ++ i) - bb.merge(o->instance_bounding_box(i, false)); + if (o->printable) // only center around printable objects (note: seems always true right now) + for (size_t i = 0; i < o->instances.size(); ++ i) + if (o->instances[i]->printable) // only center around printable instances + bb.merge(o->instance_bounding_box(i, false)); Vec2d shift2 = point - to_2d(bb.center()); if (std::abs(shift2(0)) < EPSILON && std::abs(shift2(1)) < EPSILON)