Archived issue #0025374
[6.8.0beta regression] gp_Trsf2d::SetMirror() looses transformation form
Description
gp_Trsf2d::SetMirror(gp_Ax2d) stopped retaining gp_Ax1Mirror form and started reporting gp_CompoundTrsf.
This has severe hit for us at CAD Exchanger as many algorithms rely on gp_Ax1Mirror form correctly returned.
This has severe hit for us at CAD Exchanger as many algorithms rely on gp_Ax1Mirror form correctly returned.
Steps to reproduce
void gp_Trsf2dTest::SetMirror()
{
gp_Trsf2d aTrsf2d;
aTrsf2d.SetMirror (gp_Ax2d (gp::Origin2d(), gp_Dir2d (1., 1.)));
QCOMPARE(static_cast<int> (aTrsf2d.Form()), static_cast<int> (gp_Ax1Mirror));
}
{
gp_Trsf2d aTrsf2d;
aTrsf2d.SetMirror (gp_Ax2d (gp::Origin2d(), gp_Dir2d (1., 1.)));
QCOMPARE(static_cast<int> (aTrsf2d.Form()), static_cast<int> (gp_Ax1Mirror));
}
Public activity
15 archived notes
Participants are labeled by their role within this record.
The regression is due to some recent commits in master. Most likely - #0025194, where SetValues() is called at the end of SetMirror() and sets the form to gp_CompoundTrsf.
Please double-check all the methods where SetValue() is now called, both in gp_Trsf2d and gp_Trsf. Adding unit tests for all those methods (e.g. as simple as the reproducer above) would be useful.
Please double-check all the methods where SetValue() is now called, both in gp_Trsf2d and gp_Trsf. Adding unit tests for all those methods (e.g. as simple as the reproducer above) would be useful.
A quick fix to set shape form after calling SetValues() did the trick and restored previous behavior:
void gp_Trsf2d::SetMirror (const gp_Ax2d& A)
{
// shape = gp_Ax1Mirror; //RLN
const gp_Dir2d& V = A.Direction ();
const gp_Pnt2d& P = A.Location ();
Standard_Real VX = V.X();
Standard_Real VY = V.Y();
Standard_Real X0 = P.X();
Standard_Real Y0 = P.Y();
SetValues(1.0-2.0*VX*VX, -2.0*VX*VY, -2.0*((VX * VX - 1.0)*X0 + (VX*VY*Y0)),
-2.0*VX*VY, 1.0-2.0*VY*VY, -2.0*((VX*VY*X0)+(VY*VY-1.0)*Y0));
shape = gp_Ax1Mirror; //RLN
scale = - 1.0;
}
To make sure the fix is complete in other places I will refrain from pushing the fix. Instead I'd rather suggest the author of #0025194 to make another review and another commit to address this regression.
void gp_Trsf2d::SetMirror (const gp_Ax2d& A)
{
// shape = gp_Ax1Mirror; //RLN
const gp_Dir2d& V = A.Direction ();
const gp_Pnt2d& P = A.Location ();
Standard_Real VX = V.X();
Standard_Real VY = V.Y();
Standard_Real X0 = P.X();
Standard_Real Y0 = P.Y();
SetValues(1.0-2.0*VX*VX, -2.0*VX*VY, -2.0*((VX * VX - 1.0)*X0 + (VX*VY*Y0)),
-2.0*VX*VY, 1.0-2.0*VY*VY, -2.0*((VX*VY*X0)+(VY*VY-1.0)*Y0));
shape = gp_Ax1Mirror; //RLN
scale = - 1.0;
}
To make sure the fix is complete in other places I will refrain from pushing the fix. Instead I'd rather suggest the author of #0025194 to make another review and another commit to address this regression.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: nbv
Date: Thu Oct 16 10:27:53 2014 +0400
0025374: [6.8.0beta regression] gp_Trsf2d::SetMirror() looses transformation form
1. Method Orthogonalize is called in case of transform matrix change.
2. gp_TrsfForms are set after SetValues(...) method calling from methods of gp_Trsf2d class.
[revision removed]
Detailed log of new commits:
Author: nbv
Date: Thu Oct 16 10:27:53 2014 +0400
0025374: [6.8.0beta regression] gp_Trsf2d::SetMirror() looses transformation form
1. Method Orthogonalize is called in case of transform matrix change.
2. gp_TrsfForms are set after SetValues(...) method calling from methods of gp_Trsf2d class.
Dear Andrey!
Please review branch CR25374.
Please review branch CR25374.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Dear Andrey!
Please review CR25374 branch again.
Please review CR25374 branch again.
No remarks, please test
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Dear Commenter 1,
Branch CR25374 (and products from GIT master) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component:
Linux: 15 (15 on master)
Windows: 0 (0 on master)
products component:
Linux: 11 (11 on master)
Windows: 1 (1 on master)
Regressions/Differences:
http://occt-tests/CR25374-master-occt/Debian60-64/summary.html
http://occt-tests/CR25374-master-occt/Windows-32-VC10/summary.html
de iges_1(001) J9,K3
de iges_2(002) B8, E6, G1
Testing cases:
Not needed
However, necessity to create test-cases will be defined in frame of #0025389
Testing on Linux:
Total MEMORY difference: 367272704 / 367465072
Total CPU difference: 47379.94999999994 / 44339.100000000006
Testing on Windows:
Total MEMORY difference: 255002692 / 252142604
Total CPU difference: 32317.875 / 34651.0625
There are differences in images found by testdiff:
http://occt-tests/CR25374-master-occt/Debian60-64/diff-Debian60-64.html
http://occt-tests/CR25374-master-occt/Windows-32-VC10/diff-Windows-32-VC10.html
Pay attention to bugs iges bug13627 (on Windows only)
Branch CR25374 (and products from GIT master) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]
Number of compiler warnings:
occt component:
Linux: 15 (15 on master)
Windows: 0 (0 on master)
products component:
Linux: 11 (11 on master)
Windows: 1 (1 on master)
Regressions/Differences:
http://occt-tests/CR25374-master-occt/Debian60-64/summary.html
http://occt-tests/CR25374-master-occt/Windows-32-VC10/summary.html
de iges_1(001) J9,K3
de iges_2(002) B8, E6, G1
Testing cases:
Not needed
However, necessity to create test-cases will be defined in frame of #0025389
Testing on Linux:
Total MEMORY difference: 367272704 / 367465072
Total CPU difference: 47379.94999999994 / 44339.100000000006
Testing on Windows:
Total MEMORY difference: 255002692 / 252142604
Total CPU difference: 32317.875 / 34651.0625
There are differences in images found by testdiff:
http://occt-tests/CR25374-master-occt/Debian60-64/diff-Debian60-64.html
http://occt-tests/CR25374-master-occt/Windows-32-VC10/diff-Windows-32-VC10.html
Pay attention to bugs iges bug13627 (on Windows only)
Dear Alexei!
Please update regression tests according to their new behavior.
The bug should be TESTED.
P.S.
The solution about test case will be applied after the fix of bug #0025389 related.
Please update regression tests according to their new behavior.
The bug should be TESTED.
P.S.
The solution about test case will be applied after the fix of bug #0025389 related.
Branch [archived branch] has been updated by Participant.
[revision removed]
Detailed log of new commits:
Author: apv
Date: Thu Oct 23 17:19:21 2014 +0400
Update of test-cases
[revision removed]
Detailed log of new commits:
Author: apv
Date: Thu Oct 23 17:19:21 2014 +0400
Update of test-cases
Test-cases are updated.
Note that update of DE test cases for this issue mostly reverts changes made in #0025194
The reason of these changes was in forceful orthogonalize of transformation matrix for corresponding transformations (mirror, translation etc.).
Now these matrix are not orthogonalized because they are considered to be orthogonal. However, this condition is satisfied with some error, which are decreased after forceful orthogonalize.
P.S.
The error even in ~ 1.0e-16 results in changing in shape (it will get another structure).
Now these matrix are not orthogonalized because they are considered to be orthogonal. However, this condition is satisfied with some error, which are decreased after forceful orthogonalize.
P.S.
The error even in ~ 1.0e-16 results in changing in shape (it will get another structure).
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Related records