mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 04:15:52 +08:00
Tech ENABLE_WORLD_COORDINATE - Revisited rotation of single volume
Fixed conflicts during rebase with master
This commit is contained in:
parent
c29bb039a6
commit
9706f16e69
@ -563,8 +563,7 @@ void ObjectManipulation::update_ui_from_settings()
|
|||||||
}
|
}
|
||||||
m_check_inch->SetValue(m_imperial_units);
|
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";
|
m_use_colors = wxGetApp().app_config->get("color_mapinulation_panel") == "1";
|
||||||
// update colors for edit-boxes
|
// update colors for edit-boxes
|
||||||
int axis_id = 0;
|
int axis_id = 0;
|
||||||
@ -624,11 +623,10 @@ void ObjectManipulation::update_settings_value(const Selection& selection)
|
|||||||
#if ENABLE_WORLD_COORDINATE
|
#if ENABLE_WORLD_COORDINATE
|
||||||
if (is_world_coordinates()) {
|
if (is_world_coordinates()) {
|
||||||
m_new_position = volume->get_instance_offset();
|
m_new_position = volume->get_instance_offset();
|
||||||
m_new_rotate_label_string = L("Rotate");
|
|
||||||
#else
|
#else
|
||||||
if (m_world_coordinates) {
|
if (m_world_coordinates) {
|
||||||
m_new_rotate_label_string = L("Rotate");
|
|
||||||
#endif // ENABLE_WORLD_COORDINATE
|
#endif // ENABLE_WORLD_COORDINATE
|
||||||
|
m_new_rotate_label_string = L("Rotate");
|
||||||
m_new_rotation = Vec3d::Zero();
|
m_new_rotation = Vec3d::Zero();
|
||||||
m_new_size = selection.get_scaled_instance_bounding_box().size();
|
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;
|
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
|
#else
|
||||||
const Vec3d& offset = trafo.get_offset();
|
const Vec3d& offset = trafo.get_offset();
|
||||||
#endif // ENABLE_WORLD_COORDINATE_VOLUMES_LOCAL_OFFSET
|
#endif // ENABLE_WORLD_COORDINATE_VOLUMES_LOCAL_OFFSET
|
||||||
// const Vec3d& mirror = trafo.get_mirror();
|
|
||||||
|
|
||||||
m_new_position = offset;
|
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_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;
|
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()) {
|
else if (is_local_coordinates()) {
|
||||||
|
m_new_move_label_string = L("Translate");
|
||||||
m_new_position = Vec3d::Zero();
|
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_scale = volume->get_volume_scaling_factor() * 100.0;
|
||||||
m_new_size = volume->get_volume_scaling_factor().cwiseProduct(volume->bounding_box().size());
|
m_new_size = volume->get_volume_scaling_factor().cwiseProduct(volume->bounding_box().size());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#endif // ENABLE_WORLD_COORDINATE
|
#endif // ENABLE_WORLD_COORDINATE
|
||||||
m_new_position = volume->get_volume_offset();
|
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
|
#if ENABLE_WORLD_COORDINATE
|
||||||
m_new_size = volume->transformed_convex_hull_bounding_box(volume->get_volume_transformation().get_matrix()).size();
|
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;
|
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;
|
||||||
|
@ -902,7 +902,8 @@ void Selection::rotate(const Vec3d& rotation, TransformationType transformation_
|
|||||||
else if (is_single_volume_or_modifier()) {
|
else if (is_single_volume_or_modifier()) {
|
||||||
if (transformation_type.local()) {
|
if (transformation_type.local()) {
|
||||||
const Transform3d m = Geometry::assemble_transform(Vec3d::Zero(), rotation);
|
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()) {
|
else if (transformation_type.instance()) {
|
||||||
const Transform3d m = Geometry::assemble_transform(Vec3d::Zero(), rotation);
|
const Transform3d m = Geometry::assemble_transform(Vec3d::Zero(), rotation);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user