DiscussionsIssue archiveOCCT:Data Exchange

Archived issue #0032922

Data Exchange, STEP - The torus is stored incorrectly in STEP format

Open CASCADEOCCT:Data Exchangeclosed42 public notes

Search issues

Description

If you create a torus and save it in STEP format, then after it is loaded and converted to TopoDS_Shape and before the ShapeHealing procedure is applied, the wire specifying the only face of the torus has an incorrect edge orientation.

Steps to reproduce

To reproduce the problem you must to turn off shape healing procedure in STEP read processing.
This can be done with
XSTEPResource/STEP
file.
The script
bug32922
was made to simplify the task.
Just put it on
tests/bugs/step/
directory and run.

Public activity

42 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Apr 8 14:16:01 2022 +0300

    0032922: Some refactoring. Replaced circle through edges after ShapeFix_Wire::FixReorder() to BRepTools_WireExplorer circle.
02Commenter 1
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Mon Apr 11 14:06:43 2022 +0300

    0032922: Some refactoring. Added extra analysis in UV-space for toroidal surface.

Author: Author
Date: Mon Apr 11 12:18:15 2022 +0300

    0032922: Some refactoring. Added extra analysis in UV-space for toroidal surface.
03Commenter 1
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Thu Apr 14 14:21:31 2022 +0300

    0032922: Some refactoring. 3D and 2D mode.
04Commenter 1
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Apr 15 11:24:48 2022 +0300

    0032922: Some refactoring. Both mode only if capable.

Author: Author
Date: Thu Apr 14 16:25:22 2022 +0300

    0032922: Some refactoring. 3D and 2D mode.

Author: Author
Date: Thu Apr 14 16:20:36 2022 +0300

    0032922: Some refactoring. 3D and 2D mode.
05Commenter 1
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Apr 15 21:32:22 2022 +0300

    0032922: Some refactoring.

Author: Author
Date: Fri Apr 15 13:52:07 2022 +0300

    0032922: Some refactoring. Both mode only if capable. test file
06Commenter 1
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Apr 15 22:17:43 2022 +0300

    0032922: Some refactoring. Minus file
07Commenter 1
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Mon Apr 18 11:23:31 2022 +0300

    0032922_2: Back from enum to bool.
08Commenter 1
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Mon Apr 18 14:40:44 2022 +0300

    0032922_2: isShiftForward -> nothing to do
09Commenter 1
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Wed Apr 20 11:14:31 2022 +0300

    0032922_2: -save to file, +theModeBoth

Author: Author
Date: Tue Apr 19 15:48:53 2022 +0300

    0032922_2: test cr standard C9
10Commenter 1
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Wed Apr 20 16:53:54 2022 +0300

    0032922_2: comments + fix test
11Commenter 1
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Wed Apr 20 19:34:42 2022 +0300

    0032922_3: aCurMin = Min(aMinDistToTail, aMinDistToHead);
12Commenter 1
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Thu Apr 21 15:17:48 2022 +0300

    0032922_3: added FromSTEP2 = without healing
13Commenter 14
The test has been created to detect the problem. No more need to use debugger.
bug32922 (4,392 bytes)   
14Commenter 1
Branch [archived branch] has been deleted by Author.

[revision removed]
15Commenter 1
Branch [archived branch] has been deleted by Author.

[revision removed]
16Commenter 1
Branch [archived branch] has been deleted by Author.

[revision removed]
17Commenter 1
Branch [archived branch] has been deleted by Author.

[revision removed]
18Commenter 1
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Apr 8 14:16:01 2022 +0300

    0032922: Added a mode for reordering edges in the wire with simultaneous use of 2d and 3d information. The new mode is used for torus-like surfaces before saving to STEP format. Added a test.
19Commenter 20
Added a mode for reordering edges in the wire with simultaneous use of 2d and 3d information to ShapeAnalysis_WireOrder. The new mode is used only for torus-like surfaces (ShapeFix_Wire::FixReorder) and only before saving to STEP format (TopoDSToStep_MakeStepWire).
20Commenter 1
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Mon Apr 25 15:19:30 2022 +0300

    0032922_1: removed unused include

Author: Author
Date: Mon Apr 25 15:17:02 2022 +0300

    Merge branch 'master' into CR32922_1
21Commenter 1
Branch [archived branch] has been deleted by Author.

[revision removed]
22Commenter 1
Branch [archived branch] has been deleted by Author.

[revision removed]
23Commenter 1
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Apr 8 14:16:01 2022 +0300

    0032922:
    Problem: the complete surface of the torus is not stored correctly in STEP format due to the fact that the edges are not properly ordered.
    Change: added a mode for reordering edges in the wire with simultaneous use of 2d and 3d information (ShapeAnalysis_WireOrder). The new mode is used for torus-like surfaces before saving to STEP format.
     Result: Torus correctly stored.
24Commenter 25
The first line of the first commit must contain the bug summary followed by the empty line.

General remark: according to coding rules when a simple type is passed as value argument it should be declared const. So, do not change old interfaces and use it in a new one.

src/ShapeAnalysis/ShapeAnalysis_Wire.cxx
-  CheckOrder (sawo, isClosed, mode3d);
+  CheckOrder(sawo, isClosed, mode3d, Standard_False);

Tune your text editor to insert a space before open parenthesis.
595: do not raise fail status if you are not going to return false.

src/ShapeAnalysis/ShapeAnalysis_WireOrder.hxx
158: witch -> which, is works -> works
170: for pure 2D points it is better to use TColgp_HSequenceOfXY.

src/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx
98: It is not following the method description. It must check the condition "myMode != aNewMode".
226: restore the method cover.
240: instead use NCollection_Sequence<Handle(TColStd_HSequenceOfInteger)>.
245: TColgp_Array1OfXY
268: gp_Pnt2d
287,464: remove comment
449: remove extra code
459: move definition of aCloseDist where it is used.
504: replace with simple break, but aLoops.Append(anEdgeSeq) restore again after the cycle.
755: if the mode is Both it is needed to get coords from myXY.

src/TopoDSToStep/TopoDSToStep_MakeStepWire.cxx
208 and below: replace tabs with spaces

src/XSTEPResource/STEP
Not relevant only spacing changes, please revert.

tests/bugs/step/bug32922
2: output the full bug summary
25Commenter 26
Result of the bug32922 script for master branch.
Attachment 2 (PNG) (9,776 bytes)   
26Commenter 1
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri May 6 12:03:31 2022 +0300

    Merge remote-tracking branch 'origin/CR32922' into CR32922

Author: Author
Date: Fri Apr 8 14:16:01 2022 +0300

    0032922:
    Problem: the complete surface of the torus is not stored correctly in STEP format due to the fact that the edges are not properly ordered.
    Change: added a mode for reordering edges in the wire with simultaneous use of 2d and 3d information (ShapeAnalysis_WireOrder). The new mode is used for torus-like surfaces before saving to STEP format.
     Result: Torus correctly stored.
27Commenter 1
Branch [archived branch] has been deleted by Author.

[revision removed]
28Commenter 1
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Apr 8 14:16:01 2022 +0300

    0032922:
    Problem: the complete surface of the torus is not stored correctly in STEP format due to the fact that the edges are not properly ordered.
    Change: added a mode for reordering edges in the wire with simultaneous use of 2d and 3d information (ShapeAnalysis_WireOrder). The new mode is used for torus-like surfaces before saving to STEP format.
     Result: Torus correctly stored.
29Commenter 1
Branch [archived branch] has been deleted by Author.

[revision removed]
30Commenter 1
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Wed May 11 14:04:10 2022 +0300

    # consideration of comments from the review

Author: Author
Date: Fri Apr 8 14:16:01 2022 +0300

    0032922: Bug in ShapeFix_Wire.cxx, ShapeAnalysis_Wire.cxx, ShapeAnalysis_WireOrder.cxx
    
    Problem: the complete surface of the torus is not stored correctly in STEP format due to the fact that the edges are not properly ordered.
    Change: added a mode for reordering edges in the wire with simultaneous use of 2d and 3d information (ShapeAnalysis_WireOrder). The new mode is used for torus-like surfaces before saving to STEP format.
     Result: Torus correctly stored.
31Commenter 32
Comments from the review have been eliminated
32Commenter 33
The first line of the first commit must contain the bug summary.

src/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx
125: Make new myXY only in ModeBoth. Otherwise just nullify it.
176: theStart2d is of type gp_XY already, so no need to create a temporary variable.
532: syntax "is than", use 'when' or 'that'.
547: use const&.
757: what if Mode3d?
33Commenter 1
Branch [archived branch] has been deleted by Author.

[revision removed]
34Commenter 1
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Wed May 11 14:04:10 2022 +0300

    # consideration of comments from the review

Author: Author
Date: Tue May 24 11:22:21 2022 +0300

    # remarks correction from the review2

Author: Author
Date: Fri Apr 8 14:16:01 2022 +0300

    0032922: Data Exchange, STEP - The torus is stored incorrectly in STEP format
    
    Problem: the complete surface of the torus is not stored correctly in STEP format due to the fact that the edges are not properly ordered.
    Change: added a mode for reordering edges in the wire with simultaneous use of 2d and 3d information (ShapeAnalysis_WireOrder). The new mode is used for torus-like surfaces before saving to STEP format.
     Result: Torus correctly stored.
35Commenter 1
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: ifv
Date: Mon May 16 11:37:40 2022 +0300

    0032973: Modeling Algorithms - Regression in BRepExtrema_DistShapeShape compared with 7.5
    
    BRepExtrema/BRepExtrema_ExtCF.cxx - set correct using BRepAdaptor_Curve in Extrema
    tests/bugs/modalg_8/bug32973 - new test case added

Author: mgerus
Date: Wed May 18 09:45:05 2022 +0300

    0026697: BRepFeat_MakePrism returns empty compound
    
    Add fix in direction of prism calculation

Author: Commenter 2
Date: Mon May 16 23:02:31 2022 +0300

    0032976: Visualization - AIS_InteractiveContext::FitSelected() includes objects invisible in current View

Author: Commenter 2
Date: Mon May 16 22:28:09 2022 +0300

    0032975: Visualization, TKOpenGl - do not blit inactive Subview

Author: aml
Date: Fri Jan 14 18:56:30 2022 +0300

    0032969: Coding - get rid of unused headers [IMeshData to PLib]
    
    Removed unused exception classes OSD_Exception_FLT_DIVIDE_BY_ZERO, OSD_Exception_INT_DIVIDE_BY_ZERO, OSD_Exception_FLT_DENORMAL_OPERAND, OSD_Exception_FLT_INEXACT_RESULT, OSD_Exception_FLT_INVALID_OPERATION, OSD_Exception_FLT_OVERFLOW, OSD_Exception_FLT_STACK_CHECK, OSD_Exception_FLT_UNDERFLOW.

Author: mgerus
Date: Wed May 11 16:08:55 2022 +0300

    0032807: Modeling Algorithms - Bad result of sweep operation when the UEdges has more than one intersect points
    
    Add choosing the intersect point taking into account the tangentCross when prev UEdge and next UEdge has more than one intersect points;
    Add exact correction of edge tolerance (it fix problems with edge tolerance on Linux);
    Add exact check of edge tolerance in testcase

Author: Commenter 2
Date: Sun May 15 01:11:06 2022 +0300

    0032970: Visualization, TKOpenGl - fix compilation on Linux: 'False' was not declared
36Commenter 1
Branch [archived branch] has been deleted by Author.

[revision removed]
37Commenter 1
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Apr 8 14:16:01 2022 +0300

    0032922: Data Exchange, STEP - The torus is stored incorrectly in STEP format
    
    Problem: the complete surface of the torus is not stored correctly in STEP format due to the fact that the edges are not properly ordered.
    Change: added a mode for reordering edges in the wire with simultaneous use of 2d and 3d information (ShapeAnalysis_WireOrder). The new mode is used for torus-like surfaces before saving to STEP format.
     Result: Torus correctly stored.

Author: Author
Date: Wed May 11 14:04:10 2022 +0300

    # consideration of comments from the review

Author: Author
Date: Tue May 24 11:22:21 2022 +0300

    # remarks correction from the review2
38Commenter 1
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Tue May 24 14:20:22 2022 +0300

    # fix regression
39Commenter 40
Corrected remarks
40Commenter 41
For integration:
occt - CR32922
products - none
41Commenter 42
Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
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: 18742.72000000061 / 18677.050000000647 [+0.35%]
Products
Total CPU difference: 11723.460000000106 / 11729.870000000092 [-0.05%]
Windows-64-VC14:
OCCT
Total CPU difference: 20706.5625 / 20665.84375 [+0.20%]
Products
Total CPU difference: 13249.46875 / 13282.171875 [-0.25%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
42Commenter 1
Branch [archived branch] has been deleted by Participant.

[revision removed]