Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PartDesign::Mirrored #816

Closed
wants to merge 7 commits into from
19 changes: 9 additions & 10 deletions src/Mod/Part/App/TopoShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,20 +372,19 @@ void TopoShape::convertToMatrix(const gp_Trsf& trsf, Base::Matrix4D& mtrx)
#if OCC_VERSION_HEX >= 0x070000
gp_Mat m = trsf.VectorialPart();
gp_XYZ p = trsf.TranslationPart();
Standard_Real scale = trsf.ScaleFactor();

// set Rotation matrix
mtrx[0][0] = scale * m(1,1);
mtrx[0][1] = scale * m(1,2);
mtrx[0][2] = scale * m(1,3);
mtrx[0][0] = m(1,1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the scale factor here makes this function inconsistent for OCC < 7.0 and >= 7.0
So, what is the reason of removing it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gp_Trsf::VectorialPart returns the 3x3 matrix including the scale factor now [1], an equivalent change to me removing the (redundant) scale factor multiplication here would be to change to gp_Trsf::HVectorialPart [2] which does not include the scale factor.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok. Thx for the pointer.

mtrx[0][1] = m(1,2);
mtrx[0][2] = m(1,3);

mtrx[1][0] = scale * m(2,1);
mtrx[1][1] = scale * m(2,2);
mtrx[1][2] = scale * m(2,3);
mtrx[1][0] = m(2,1);
mtrx[1][1] = m(2,2);
mtrx[1][2] = m(2,3);

mtrx[2][0] = scale * m(3,1);
mtrx[2][1] = scale * m(3,2);
mtrx[2][2] = scale * m(3,3);
mtrx[2][0] = m(3,1);
mtrx[2][1] = m(3,2);
mtrx[2][2] = m(3,3);

// set pos vector
mtrx[0][3] = p.X();
Expand Down