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:
authorenricoturri1966 <enricoturri@seznam.cz>2022-02-14 14:48:51 +0300
committerenricoturri1966 <enricoturri@seznam.cz>2022-06-03 11:26:37 +0300
commit9706f16e69b0f9cfb97862520fb69593e9cf8b3e (patch)
tree67bc2efbb792b4266f436ac8f5061928b882041e
parentc29bb039a6e11a43dbe793e52dcb13b70acf3a64 (diff)
Tech ENABLE_WORLD_COORDINATE - Revisited rotation of single volume
Fixed conflicts during rebase with master
-rw-r--r--src/slic3r/GUI/GUI_ObjectManipulation.cpp16
-rw-r--r--src/slic3r/GUI/Selection.cpp3
2 files changed, 10 insertions, 9 deletions
diff --git a/src/slic3r/GUI/GUI_ObjectManipulation.cpp b/src/slic3r/GUI/GUI_ObjectManipulation.cpp
index 935264d69..dd7256d2a 100644
--- a/src/slic3r/GUI/GUI_ObjectManipulation.cpp
+++ b/src/slic3r/GUI/GUI_ObjectManipulation.cpp
@@ -563,8 +563,7 @@ void ObjectManipulation::update_ui_from_settings()
}
m_check_inch->SetValue(m_imperial_units);
- if (m_use_colors != (wxGetApp().app_config->get("color_mapinulation_panel") == "1"))
- {
+ if (m_use_colors != (wxGetApp().app_config->get("color_mapinulation_panel") == "1")) {
m_use_colors = wxGetApp().app_config->get("color_mapinulation_panel") == "1";
// update colors for edit-boxes
int axis_id = 0;
@@ -624,11 +623,10 @@ void ObjectManipulation::update_settings_value(const Selection& selection)
#if ENABLE_WORLD_COORDINATE
if (is_world_coordinates()) {
m_new_position = volume->get_instance_offset();
- m_new_rotate_label_string = L("Rotate");
#else
if (m_world_coordinates) {
- m_new_rotate_label_string = L("Rotate");
#endif // ENABLE_WORLD_COORDINATE
+ m_new_rotate_label_string = L("Rotate");
m_new_rotation = Vec3d::Zero();
m_new_size = selection.get_scaled_instance_bounding_box().size();
m_new_scale = m_new_size.cwiseProduct(selection.get_unscaled_instance_bounding_box().size().cwiseInverse()) * 100.0;
@@ -671,23 +669,25 @@ void ObjectManipulation::update_settings_value(const Selection& selection)
#else
const Vec3d& offset = trafo.get_offset();
#endif // ENABLE_WORLD_COORDINATE_VOLUMES_LOCAL_OFFSET
-// const Vec3d& mirror = trafo.get_mirror();
m_new_position = offset;
- m_new_rotation = trafo.get_rotation() * (180.0 / M_PI);
+ m_new_rotate_label_string = L("Rotate");
+ m_new_rotation = Vec3d::Zero();
m_new_size = volume->transformed_convex_hull_bounding_box(trafo.get_matrix()).size();
m_new_scale = m_new_size.cwiseProduct(volume->transformed_convex_hull_bounding_box(volume->get_instance_transformation().get_matrix() * volume->get_volume_transformation().get_matrix(false, false, true, false)).size().cwiseInverse()) * 100.0;
}
else if (is_local_coordinates()) {
+ m_new_move_label_string = L("Translate");
m_new_position = Vec3d::Zero();
- m_new_rotation = Vec3d::Zero();
+ m_new_rotation = volume->get_volume_rotation() * (180.0 / M_PI);
m_new_scale = volume->get_volume_scaling_factor() * 100.0;
m_new_size = volume->get_volume_scaling_factor().cwiseProduct(volume->bounding_box().size());
}
else {
#endif // ENABLE_WORLD_COORDINATE
m_new_position = volume->get_volume_offset();
- m_new_rotation = volume->get_volume_rotation() * (180.0 / M_PI);
+ m_new_rotate_label_string = L("Rotate");
+ m_new_rotation = Vec3d::Zero();
#if ENABLE_WORLD_COORDINATE
m_new_size = volume->transformed_convex_hull_bounding_box(volume->get_volume_transformation().get_matrix()).size();
m_new_scale = m_new_size.cwiseProduct(volume->transformed_convex_hull_bounding_box(volume->get_volume_transformation().get_matrix(false, false, true, false)).size().cwiseInverse()) * 100.0;
diff --git a/src/slic3r/GUI/Selection.cpp b/src/slic3r/GUI/Selection.cpp
index 87d651aa1..4931448ba 100644
--- a/src/slic3r/GUI/Selection.cpp
+++ b/src/slic3r/GUI/Selection.cpp
@@ -902,7 +902,8 @@ void Selection::rotate(const Vec3d& rotation, TransformationType transformation_
else if (is_single_volume_or_modifier()) {
if (transformation_type.local()) {
const Transform3d m = Geometry::assemble_transform(Vec3d::Zero(), rotation);
- v.set_volume_rotation(Geometry::extract_euler_angles(m_cache.volumes_data[i].get_volume_rotation_matrix() * m));
+ const Vec3d new_rotation = transformation_type.absolute() ? rotation : Geometry::extract_euler_angles(m_cache.volumes_data[i].get_volume_rotation_matrix() * m);
+ v.set_volume_rotation(new_rotation);
}
else if (transformation_type.instance()) {
const Transform3d m = Geometry::assemble_transform(Vec3d::Zero(), rotation);