mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-01 17:52:07 +08:00
Fixed rotation of parts when mirror is applied
This commit is contained in:
parent
7bbd1d1896
commit
deefe1b2e9
@ -998,7 +998,7 @@ void Selection::rotate(const Vec3d& rotation, TransformationType transformation_
|
|||||||
|
|
||||||
assert(transformation_type.relative() || (transformation_type.absolute() && transformation_type.local()));
|
assert(transformation_type.relative() || (transformation_type.absolute() && transformation_type.local()));
|
||||||
|
|
||||||
const Transform3d rotation_matrix = Geometry::rotation_transform(rotation);
|
Transform3d rotation_matrix = Geometry::rotation_transform(rotation);
|
||||||
|
|
||||||
for (unsigned int i : m_list) {
|
for (unsigned int i : m_list) {
|
||||||
GLVolume& v = *(*m_volumes)[i];
|
GLVolume& v = *(*m_volumes)[i];
|
||||||
@ -1027,6 +1027,8 @@ void Selection::rotate(const Vec3d& rotation, TransformationType transformation_
|
|||||||
// ensure that the volume rotates as a rigid body
|
// ensure that the volume rotates as a rigid body
|
||||||
const Geometry::Transformation& vol_trafo = volume_data.get_volume_transform();
|
const Geometry::Transformation& vol_trafo = volume_data.get_volume_transform();
|
||||||
const Transform3d cached_vol_rotation_matrix = vol_trafo.get_rotation_matrix();
|
const Transform3d cached_vol_rotation_matrix = vol_trafo.get_rotation_matrix();
|
||||||
|
if ((inst_trafo * vol_trafo).is_left_handed() && !rotation.normalized().isApprox(Vec3d::UnitX()))
|
||||||
|
rotation_matrix = rotation_matrix.inverse();
|
||||||
v.set_volume_transformation(vol_trafo.get_matrix() * cached_vol_rotation_matrix.inverse() * rotation_matrix * cached_vol_rotation_matrix);
|
v.set_volume_transformation(vol_trafo.get_matrix() * cached_vol_rotation_matrix.inverse() * rotation_matrix * cached_vol_rotation_matrix);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user