View Issue Details

IDProjectCategoryView StatusLast Update
0029406Open CASCADEOCCT:Foundation Classespublic2022-07-20 14:23
Reporterabv Assigned Tosmoskvin  
PrioritynormalSeverityminor 
Status verifiedResolutionfixed 
Target Version7.6.3 
Summary0029406: Foundation Classes - gp_Ax3 fails setting direction
DescriptionThe following simple code fails due to stupid implementation of gp_Ax3 which does not check that newly set direction is parallel to currently set X direction, and tries to use their cross product to define new Y:

gp_Ax3 anAx;
anAx.SetDirection (gp::DX());

The same occurs with construction from gp_Ax1:

gp_Ax1 anAx1 (gp::Origin(), gp::DX());
anAx.SetAxis (anAx1);
Steps To Reproduce.
TagsNo tags attached.
Test case numberbugs/fclasses/bug29406

Relationships

related to 0029671 newabv Community Foundation Classes - Remove the direction recomputed mechanism for gp_Ax2 

Activities

git

2018-01-11 19:03

administrator   ~0073368

Branch CR29406 has been created by isn.

SHA-1: 7f911703334699158a648a55bb13648fe862593e


Detailed log of new commits:

Author: isn
Date: Thu Jan 11 19:03:03 2018 +0300

    0029406: Foundation Classes - gp_Ax3 fails setting direction
    
    Avoid exception in gp_Ax3::SetDirection(), SetAxis(): check if XDir of Ax3 is parallel to newly given direction.

isn

2018-01-16 14:05

developer   ~0073433

Last edited: 2018-01-16 14:05

/view/CR29406-master-isn/view/COMPARE/

msv

2018-01-17 11:42

developer   ~0073460

Please rebase the branch on current master and re-test. The commit must be based on master only (not on 28642 fix).

git

2018-01-17 12:41

administrator   ~0073464

Branch CR29406 has been updated forcibly by isn.

SHA-1: af061f95c6a6e94dbdde77558332f25b870f95b8

msv

2018-01-17 13:00

developer   ~0073468

tests/bugs/fclasses/bug29406
- Add standard header into the test script.

src/gp/gp_Ax3.lxx
- 47,71: move this definition to the scope where it is used.

src/QABugs/QABugs_20.cxx
- 2803: set negative DX.
- Eliminate code duplication by defining a new function that makes needed checks and puts error in cout. No need to return 1 for the test became failure.
- Add checking of the fact that direction in the object has the value that has been just set.

git

2018-01-18 17:06

administrator   ~0073496

Branch CR29406 has been updated by isn.

SHA-1: 9212f218bf2a24e3f668ca5f9d2b999b029bb461


Detailed log of new commits:

Author: isn
Date: Thu Jan 18 17:06:04 2018 +0300

    corrections

msv

2018-01-19 10:25

developer   ~0073507

Reviewed.

msv

2018-01-19 10:36

developer   ~0073508

Last edited: 2018-01-19 10:37

Oops, I have (thanks to EMV) another remark.

Please, remove code duplication in the methods gp_Ax3::SetAxis and gp_Ax3::SetDirection. For that, make the following implementation of the method gp_Ax3::SetAxis:

axis.SetLocation(A1.Location());
SetDirection(A1.Direction());


git

2018-01-19 14:36

administrator   ~0073526

Branch CR29406 has been updated by isn.

SHA-1: 360a7e4b1ab493f47fcd2feb74b8ff350219f547


Detailed log of new commits:

Author: isn
Date: Fri Jan 19 14:33:52 2018 +0300

    remark

isn

2018-01-19 17:29

developer   ~0073539

/view/CR29406-master-isn/view

msv

2018-01-22 10:31

developer   ~0073551

Please rebase on current master and retest.

git

2018-01-22 14:08

administrator   ~0073557

Branch CR29406_1 has been created by isn.

SHA-1: 7bdbef9da526f872b1798e03ab81809147d2d492


Detailed log of new commits:

Author: isn
Date: Thu Jan 11 19:03:03 2018 +0300

    0029406: Foundation Classes - gp_Ax3 fails setting direction
    
    Avoid exception in gp_Ax3::SetDirection(), SetAxis(): check if XDir of Ax3 is parallel to newly given direction.

kgv

2021-09-20 10:55

developer   ~0104227

Mikhail, should we consider this patch for OCCT 7.6.0, or it is not ready?

msv

2021-09-27 10:34

developer   ~0104386

The methods SetXDirection and SetYDirection do also have the same problem.
I think we should fix these methods in this patch, too.

asuraven

2021-11-15 18:32

developer   ~0105201

asuraven

2021-11-16 17:53

developer   ~0105222

asuraven

2021-11-17 18:52

developer   ~0105231

git

2021-11-17 22:03

administrator   ~0105232

Branch CR29406_2 has been created by asuraven.

SHA-1: a00800b96e9de4824b3ae91f3b4856f40b9c9065


Detailed log of new commits:

Author: isn
Date: Thu Jan 11 19:03:03 2018 +0300

    0029406: Foundation Classes - gp_Ax3 fails setting direction
    
    Avoid exception in gp_Ax3::SetDirection(), SetAxis(): check if XDir of Ax3 is parallel to newly given direction.

git

2021-11-18 15:19

administrator   ~0105236

Branch CR29406_2 has been updated forcibly by asuraven.

SHA-1: 6a14c33960ad2be044b34c7eac0ed4514cadfabe

kgv

2021-11-18 15:38

developer   ~0105238

+  theCommands.Add ("OCC29406_1", "OCC29406_1", __FILE__, OCC29406_1, group);
+  theCommands.Add ("OCC29406_2", "OCC29406_2", __FILE__, OCC29406_2, group);
+  theCommands.Add ("OCC29406_3", "OCC29406_3", __FILE__, OCC29406_3, group);

Andrey, I would suggest merging unit-alike tests into a single command and provide a meaningful description to it.
QANCollection could be used as a better example for such kind of commands (like "QANColTestMap").

asuraven

2021-11-18 18:28

developer   ~0105247

git

2021-11-23 15:01

administrator   ~0105371

Branch CR29406_2 has been updated forcibly by asuraven.

SHA-1: 7d3795eee656b308b3ecc6efb0f9f758fcfe12d2

asuraven

2021-11-23 17:53

developer   ~0105373

Dear Michael, please review branch CR29406_2
Tests results are here: http://jenkins-test-occt.nnov.opencascade.com/view/CR29406_2-master-ASURAVEN/view/COMPARE/

msv

2021-11-23 23:59

developer   ~0105385

src/gp/gp_Ax3.hxx
  if(Abs(Abs(aDot) - 1.) <= Precision::Angular()) 

Extra Abs() is called. Can be replaced with (1. - Abs(aDot))

src/QABugs/QABugs_20.cxx
- 4050: this check is incorrect, because the new X direction might not be equal to the requested one according to the method documentation and implementation.
- 4064: the same as for CheckAx3DirX.

git

2021-11-24 19:56

administrator   ~0105398

Branch CR29406_2 has been updated forcibly by asuraven.

SHA-1: 195c35ee40b08b5fc36f7495f066cbb55aa357c6

asuraven

2021-11-24 20:00

developer   ~0105399

Remarks fixed in branch CR329406_2
Tests are running now

kgv

2021-11-24 20:11

developer   ~0105400

+##  Foundation Classes - gp_Ax3 fails setting direction

Please move test case description to puts.

+  theCommands.Add ("OCC29406", "OCC29406", __FILE__, OCC29406, group);

Please add description to the command.

msv

2021-11-24 23:40

developer   ~0105408

You did not understand me right concerning the checks in QABugs.
Now you check preconditions that are always true for an Ax3 object.
My idea is the following (for CheckAx3DirX):
 gp_Dir aGoodY = theAx.Direction().Crossed(theDir);
and check aGoodY with theAx.YDirection().

git

2021-11-25 14:58

administrator   ~0105421

Branch CR29406_2 has been updated forcibly by asuraven.

SHA-1: ac0efe89f8bfd96e88b1caf153f56ac6c5e0ed4a

asuraven

2021-11-25 14:59

developer   ~0105422

Remarks fixed in branch CR329406_2

msv

2021-11-25 18:47

developer   ~0105429

  //gp_Dir aY = theAxis.Direction().Crossed(theAxis.XDirection());

Remove useless commented line.

git

2021-11-25 19:03

administrator   ~0105430

Branch CR29406_2 has been updated forcibly by asuraven.

SHA-1: f6e92c178c78c94760e3e9cd5c389a4c92ee7292

asuraven

2021-11-25 19:03

developer   ~0105431

fixed

msv

2021-11-25 20:09

developer   ~0105435

For integration:
occt - CR29406_2
products -none

smoskvin

2021-11-27 14:24

administrator   ~0105468

Combination -
OCCT branch : IR-2021-11-26
master SHA - 4a837ecec21bfe24d9c224c4b59aa9779156f297
49e51745631c52b6c452c65adae4d6dfa21a1b1e
Products branch : IR-2021-11-26 SHA - 5da5872bffc6c1fa745ee5e33ac09c4fffd349b4
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 18390.380000000398 / 18549.650000000624 [-0.86%]
Products
Total CPU difference: 11648.280000000103 / 11661.570000000122 [-0.11%]
Windows-64-VC14:
OCCT
Total CPU difference: 19927.859375 / 19945.046875 [-0.09%]
Products
Total CPU difference: 13059.03125 / 13091.625 [-0.25%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2021-11-27 15:04

administrator   ~0105475

Branch CR29406 has been deleted by mnt.

SHA-1: 360a7e4b1ab493f47fcd2feb74b8ff350219f547

git

2021-11-27 15:04

administrator   ~0105476

Branch CR29406_1 has been deleted by mnt.

SHA-1: 7bdbef9da526f872b1798e03ab81809147d2d492

git

2021-11-27 15:04

administrator   ~0105477

Branch CR29406_2 has been deleted by mnt.

SHA-1: f6e92c178c78c94760e3e9cd5c389a4c92ee7292

Related Changesets

occt: master 58c0958b

2018-01-11 16:03:03

isn


Committer: smoskvin Details Diff
0029406: Foundation Classes - gp_Ax3 fails setting direction

Avoid exception in gp_Ax3::SetDirection(), SetAxis(): check if XDir of Ax3 is parallel to newly given direction.
Affected Issues
0029406
mod - src/gp/gp_Ax3.hxx Diff File
mod - src/QABugs/QABugs_20.cxx Diff File
add - tests/bugs/fclasses/bug29406 Diff File

Issue History

Date Modified Username Field Change
2017-12-29 13:51 abv New Issue
2017-12-29 13:51 abv Assigned To => abv
2018-01-09 14:36 abv Description Updated
2018-01-09 14:37 abv Description Updated
2018-01-10 16:57 abv Assigned To abv => isn
2018-01-10 16:57 abv Status new => assigned
2018-01-11 19:03 git Note Added: 0073368
2018-01-16 14:05 isn Note Added: 0073433
2018-01-16 14:05 isn Assigned To isn => msv
2018-01-16 14:05 isn Status assigned => resolved
2018-01-16 14:05 isn Steps to Reproduce Updated
2018-01-16 14:05 isn Note Edited: 0073433
2018-01-17 11:42 msv Note Added: 0073460
2018-01-17 11:42 msv Assigned To msv => isn
2018-01-17 11:42 msv Status resolved => assigned
2018-01-17 12:41 git Note Added: 0073464
2018-01-17 13:00 msv Note Added: 0073468
2018-01-18 17:06 git Note Added: 0073496
2018-01-18 20:50 isn Assigned To isn => msv
2018-01-18 20:50 isn Status assigned => resolved
2018-01-19 10:25 msv Note Added: 0073507
2018-01-19 10:25 msv Assigned To msv => bugmaster
2018-01-19 10:25 msv Status resolved => reviewed
2018-01-19 10:36 msv Note Added: 0073508
2018-01-19 10:36 msv Assigned To bugmaster => isn
2018-01-19 10:36 msv Status reviewed => assigned
2018-01-19 10:37 msv Note Edited: 0073508
2018-01-19 10:37 msv Note Edited: 0073508
2018-01-19 14:36 git Note Added: 0073526
2018-01-19 17:29 isn Note Added: 0073539
2018-01-19 17:29 isn Assigned To isn => msv
2018-01-19 17:29 isn Status assigned => resolved
2018-01-22 10:31 msv Note Added: 0073551
2018-01-22 10:31 msv Assigned To msv => isn
2018-01-22 10:31 msv Status resolved => assigned
2018-01-22 14:08 git Note Added: 0073557
2019-07-10 22:29 abv Target Version 7.4.0 => 7.5.0
2019-09-04 18:03 kgv Relationship added related to 0029671
2020-09-11 16:13 utverdov Target Version 7.5.0 => 7.6.0
2021-09-20 10:55 kgv Note Added: 0104227
2021-09-20 10:55 kgv Assigned To isn => msv
2021-09-20 10:55 kgv Status assigned => feedback
2021-09-27 10:34 msv Note Added: 0104386
2021-09-27 10:34 msv Status feedback => assigned
2021-09-27 10:34 msv Target Version 7.6.0 => 7.7.0
2021-09-27 10:34 msv Assigned To msv => szy
2021-11-15 14:46 szy Assigned To szy => asuraven
2021-11-15 18:32 asuraven Note Added: 0105201
2021-11-16 17:53 asuraven Note Added: 0105222
2021-11-17 18:52 asuraven Note Added: 0105231
2021-11-17 22:03 git Note Added: 0105232
2021-11-18 15:19 git Note Added: 0105236
2021-11-18 15:38 kgv Note Added: 0105238
2021-11-18 18:28 asuraven Note Added: 0105247
2021-11-23 15:01 git Note Added: 0105371
2021-11-23 17:53 asuraven Note Added: 0105373
2021-11-23 17:53 asuraven Assigned To asuraven => abv
2021-11-23 17:53 asuraven Status assigned => resolved
2021-11-23 17:53 asuraven Assigned To abv => msv
2021-11-23 23:59 msv Note Added: 0105385
2021-11-23 23:59 msv Assigned To msv => asuraven
2021-11-23 23:59 msv Status resolved => assigned
2021-11-24 19:56 git Note Added: 0105398
2021-11-24 20:00 asuraven Note Added: 0105399
2021-11-24 20:00 asuraven Assigned To asuraven => msv
2021-11-24 20:00 asuraven Status assigned => resolved
2021-11-24 20:11 kgv Note Added: 0105400
2021-11-24 23:40 msv Note Added: 0105408
2021-11-24 23:40 msv Assigned To msv => asuraven
2021-11-24 23:40 msv Status resolved => assigned
2021-11-25 14:58 git Note Added: 0105421
2021-11-25 14:59 asuraven Note Added: 0105422
2021-11-25 14:59 asuraven Assigned To asuraven => msv
2021-11-25 14:59 asuraven Status assigned => resolved
2021-11-25 18:47 msv Note Added: 0105429
2021-11-25 18:47 msv Assigned To msv => asuraven
2021-11-25 18:47 msv Status resolved => assigned
2021-11-25 19:03 git Note Added: 0105430
2021-11-25 19:03 asuraven Note Added: 0105431
2021-11-25 19:03 asuraven Assigned To asuraven => msv
2021-11-25 19:03 asuraven Status assigned => resolved
2021-11-25 20:09 msv Note Added: 0105435
2021-11-25 20:09 msv Assigned To msv => bugmaster
2021-11-25 20:09 msv Status resolved => reviewed
2021-11-27 14:24 smoskvin Note Added: 0105468
2021-11-27 14:24 smoskvin Status reviewed => tested
2021-11-27 14:26 smoskvin Test case number => bugs/fclasses/bug29406
2021-11-27 14:52 smoskvin Changeset attached => occt master 58c0958b
2021-11-27 14:52 smoskvin Assigned To bugmaster => smoskvin
2021-11-27 14:52 smoskvin Status tested => verified
2021-11-27 14:52 smoskvin Resolution open => fixed
2021-11-27 15:04 git Note Added: 0105475
2021-11-27 15:04 git Note Added: 0105476
2021-11-27 15:04 git Note Added: 0105477
2022-07-20 14:23 smoskvin Target Version 7.7.0 => 7.6.3