Bugfix: splitting a rotated object resulted in wrong positions. #2772
This commit is contained in:
parent
7d81aee62f
commit
79ce094e3a
1 changed files with 6 additions and 1 deletions
|
@ -482,7 +482,12 @@ ModelObject::center_around_origin()
|
||||||
|
|
||||||
if (!this->instances.empty()) {
|
if (!this->instances.empty()) {
|
||||||
for (ModelInstancePtrs::const_iterator i = this->instances.begin(); i != this->instances.end(); ++i) {
|
for (ModelInstancePtrs::const_iterator i = this->instances.begin(); i != this->instances.end(); ++i) {
|
||||||
(*i)->offset.translate(-vector.x, -vector.y);
|
// apply rotation and scaling to vector as well before translating instance,
|
||||||
|
// in order to leave final position unaltered
|
||||||
|
Vectorf3 v = vector.negative();
|
||||||
|
v.rotate(Slic3r::Geometry::deg2rad((*i)->rotation), (*i)->offset);
|
||||||
|
v.scale((*i)->scaling_factor);
|
||||||
|
(*i)->offset.translate(v.x, v.y);
|
||||||
}
|
}
|
||||||
this->update_bounding_box();
|
this->update_bounding_box();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue