Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Matena <lukasmatena@seznam.cz>2021-09-17 10:26:47 +0300
committerLukas Matena <lukasmatena@seznam.cz>2021-09-17 10:38:53 +0300
commit82b4a4fe113a948ee778635eb9a243f4375f7d60 (patch)
tree6ddebc7cb907b8e4fcaed796e461a4c446810ea9 /src/slic3r
parent0b1e716e222a6f64dc7ee2517df864e70a5060bf (diff)
Place on face improvement: respect different z-rotation of instances
Diffstat (limited to 'src/slic3r')
-rw-r--r--src/slic3r/GUI/Selection.cpp10
-rw-r--r--src/slic3r/GUI/Selection.hpp4
2 files changed, 4 insertions, 10 deletions
diff --git a/src/slic3r/GUI/Selection.cpp b/src/slic3r/GUI/Selection.cpp
index 92c758d4b..3f1848d30 100644
--- a/src/slic3r/GUI/Selection.cpp
+++ b/src/slic3r/GUI/Selection.cpp
@@ -823,10 +823,10 @@ void Selection::flattening_rotate(const Vec3d& normal)
}
#if !DISABLE_INSTANCES_SYNCH
- // we want to synchronize z-rotation as well, otherwise the flattening behaves funny
- // when applied on one of several identical instances
+ // Apply the same transformation also to other instances,
+ // but respect their possibly diffrent z-rotation.
if (m_mode == Instance)
- synchronize_unselected_instances(SYNC_ROTATION_FULL);
+ synchronize_unselected_instances(SYNC_ROTATION_GENERAL);
#endif // !DISABLE_INSTANCES_SYNCH
this->set_bounding_boxes_dirty();
@@ -2055,10 +2055,6 @@ void Selection::synchronize_unselected_instances(SyncRotationType sync_rotation_
v->set_instance_offset(Z, volume->get_instance_offset().z());
break;
}
- case SYNC_ROTATION_FULL:
- // rotation comes from place on face -> force given z
- v->set_instance_rotation({ rotation.x(), rotation.y(), rotation.z() });
- break;
case SYNC_ROTATION_GENERAL:
// generic rotation -> update instance z with the delta of the rotation.
const double z_diff = Geometry::rotation_diff_z(m_cache.volumes_data[i].get_instance_rotation(), m_cache.volumes_data[j].get_instance_rotation());
diff --git a/src/slic3r/GUI/Selection.hpp b/src/slic3r/GUI/Selection.hpp
index b3304571f..3e67640c5 100644
--- a/src/slic3r/GUI/Selection.hpp
+++ b/src/slic3r/GUI/Selection.hpp
@@ -375,10 +375,8 @@ public:
enum SyncRotationType {
// Do not synchronize rotation. Either not rotating at all, or rotating by world Z axis.
SYNC_ROTATION_NONE = 0,
- // Synchronize fully. Used from "place on bed" feature.
- SYNC_ROTATION_FULL = 1,
// Synchronize after rotation by an axis not parallel with Z.
- SYNC_ROTATION_GENERAL = 2,
+ SYNC_ROTATION_GENERAL = 1,
};
void synchronize_unselected_instances(SyncRotationType sync_rotation_type);
void synchronize_unselected_volumes();