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-05-18 10:11:20 +0300
committerenricoturri1966 <enricoturri@seznam.cz>2022-06-06 13:07:45 +0300
commit2602c6bf92f13ebb02a96c3ba0c15252b12c4d82 (patch)
treea83ded200fc43e12bff194310d8f221987bbac8d
parente4fb142afcc8db7f2fa63084d5b107d62e570c2e (diff)
Tech ENABLE_TRANSFORMATIONS_BY_MATRICES - Implemented reset skew button for the case when volume world matrix contains skew while volume and instance matrices do not
Fixed conflicts during rebase with master
-rw-r--r--src/slic3r/GUI/Selection.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/slic3r/GUI/Selection.cpp b/src/slic3r/GUI/Selection.cpp
index c377fda16..60bc8346e 100644
--- a/src/slic3r/GUI/Selection.cpp
+++ b/src/slic3r/GUI/Selection.cpp
@@ -1422,7 +1422,13 @@ void Selection::reset_skew()
const VolumeCache& volume_data = m_cache.volumes_data[i];
const Geometry::Transformation& inst_trafo = volume_data.get_instance_transform();
const Geometry::Transformation& vol_trafo = volume_data.get_volume_transform();
- if (m_mode == Instance && inst_trafo.has_skew()) {
+ const Geometry::Transformation world_trafo = inst_trafo * vol_trafo;
+ if (!inst_trafo.has_skew() && !vol_trafo.has_skew() && world_trafo.has_skew()) {
+ Geometry::Transformation mod_world_trafo = Geometry::Transformation(world_trafo.get_matrix_no_offset());
+ mod_world_trafo.reset_skew();
+ v.set_volume_transformation(vol_trafo.get_offset_matrix() * inst_trafo.get_matrix_no_offset().inverse() * mod_world_trafo.get_matrix());
+ }
+ else if (m_mode == Instance && inst_trafo.has_skew()) {
Geometry::Transformation trafo = inst_trafo;
trafo.reset_skew();
v.set_instance_transformation(trafo);
@@ -1432,19 +1438,6 @@ void Selection::reset_skew()
trafo.reset_skew();
v.set_volume_transformation(trafo);
}
- else {
- const Geometry::Transformation world_trafo = inst_trafo * vol_trafo;
- if (world_trafo.has_skew()) {
- if (m_mode == Instance) {
- // TODO
- int a = 0;
- }
- else {
- // TODO
- int a = 0;
- }
- }
- }
}
ensure_on_bed();