DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0029356

Modeling Algorithms - GCPnts_TangentialDeflection hangs on specific curve

CommunityOCCT:Modeling Algorithmsclosed29 public notes

Search issues

Description

GCPnts_TangentialDeflection hangs while computing Wireframe presentation for attached shape imported from IGES:
https://www.opencascade.com/content/surface-display-crash

There is no issue making a Shaded presentation.
The bug appeared in OCCT 7.0.0 (problem is not reproducible on OCCT 6.9.1).

Steps to reproduce

pload VISUALIZATION XDE
cpulimit 100
testreadiges problemmodel.igs a
#checkshape a a
vclear
vinit View1
vdisplay -dispMode 0 a
vfit
meminfo

Result: KO, viewer hangs.

Public activity

29 archived notes

Participants are labeled by their role within this record.

01Commenter 1
I looked at the stack under debugger and found out that the problem is in generation of iso-lines using Hatch_Hatcher algorithm. See the file StdPrs_Isolines.cxx line 509:
      Standard_Real anIsoParam = aHatcher.Coordinate (anI);

The parameter returned by hatcher for this case is equal to 968675.43832409300. The surface U range is [1437351.814,1437358.332]. So, the parameter of computed iso-line is far out of range. Dump of such iso-line looks very ugly:
*********** Dump of i *************
BSplineCurve
  Degree 5, 6 Poles, 2  Knots
Poles :

   1 : 1.1505003582441e+018, -8.83973126067367e+018, -7.07625357548475e+018
   2 : 1.34293124256749e+018, -6.34107467375981e+018, -6.1920120716081e+018
   3 : -1.9246641904371e+018, -7.30241823771635e+018, -5.2885669053654e+018
   4 : -1.54002657325621e+018, -7.49484846321211e+018, -4.51969838728099e+018
   5 : -2.69320055903921e+018, -7.11061392318922e+018, -3.96229371150243e+018
   6 : -1.34744884480842e+018, -4.61190301472812e+018, -2.86667369629048e+018
Knots :

   1 :  0 6
   2 :  13.06506657 6
02Commenter 2
The simple workaround is to skip drawing iso-line if it is out of surface domain.
But more correct way is to debug hatcher algorithm.
03Author
Dear Mikhail,

does it makes sense adding this (or maybe corrected) workaround to StdPrs_Isolines?

> Hereunder are the lines added to the StdPrs_Isolines.cxx file
> in the function addOnSurface line 512 (ver. 7.2.0):
> if (anIsoParam <  theSurface->FirstUParameter()
> || anIsoParam >  theSurface->LastUParameter())
>    continue;
04Commenter 4
Yes, it makes sense. But you need to use *UParameter or *VParameter according to isIsoU flag.
Also, it may be necessary to skip this filter for a surface periodic in this direction.
05Commenter 5
BTW, hatcher may be not the cause of the problem, because incorrect parameters can be passed to it from upper level algo.
06Commenter 6
Dear Natalia, please investigate why such incorrect parameters are passed to the hatcher.
07Commenter 2
Branch [archived branch] has been created by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Mon Jan 29 11:27:45 2018 +0300

    0029356: Modeling Algorithms - GCPnts_TangentialDeflection hangs on specific curve
    
    Additional check in StdPrs_Isolines for a case when minimum and maximum values of UV Face parameters are out of UVLimit. In such case, the class does not collect these parameter values.

Author: Commenter 3
Date: Mon Jan 29 11:19:36 2018 +0300

    0029356: Modeling Algorithms - GCPnts_TangentialDeflection hangs on specific curve
    
    Additional check in StdPrs_Isolines for a case when minimum and maximum values of UV Face parameters are out of UVLimit. In such case, the class does not collect these parameter values.
08Commenter 2
Branch [archived branch] has been updated by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Mon Jan 29 12:33:27 2018 +0300

    0029356: Modeling Algorithms - GCPnts_TangentialDeflection hangs on specific curve
    
    Additional check in StdPrs_Isolines for a case when minimum and maximum values of UV Face parameters are out of UVLimit. In such case, the class does not collect these parameter values.

09Commenter 3
Dear msv,

could you please put the attached file in test data base repository.

Thank you in advance
10Commenter 10
Done.
11Commenter 2
Branch [archived branch] has been updated by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Wed Jan 31 13:09:28 2018 +0300

    0029356: Modeling Algorithms - GCPnts_TangentialDeflection hangs on specific curve
    
    #script input file is renamed to Attachment 1 (IGS)

12Commenter 2
Branch [archived branch] has been created by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Mon Jan 29 11:19:36 2018 +0300

    0029356: Modeling Algorithms - GCPnts_TangentialDeflection hangs on specific curve
    
    While UV Iso parameters are obtained in StdPrs_Isolines, UV limits should be applied only if face bounds has infinite values.
    In the issue case, the UV values are greater than UVLimits and not infinite. This fix makes possible to have correct Iso lines in presentation without modification of UV limits beforehead.
13Commenter 3
Dear msv,

could you please review the issue.

Build on jenkins is: http://jenkins-test-10.nnov.opencascade.com/view/CR29356-master-NDS/

Thank you in advance.
14Commenter 14
Please consider verbal remarks.
15Commenter 2
Branch [archived branch] has been updated by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Mon Mar 5 10:29:13 2018 +0300

    # correcting condition to process each limit independently
    
    # providing additional v3d test cases for visos command and setMaxParamValue parameter of vaspects command.

16Commenter 2
Branch [archived branch] has been created by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Mon Jan 29 11:19:36 2018 +0300

    0029356: Modeling Algorithms - GCPnts_TangentialDeflection hangs on specific curve
    
    While UV Iso parameters are obtained in StdPrs_Isolines, UV limits should be applied only if face bounds has infinite values.
    In the issue case, the UV values are greater than UVLimits and not infinite. This fix makes possible to have correct Iso lines in presentation without modification of UV limits beforehead.
17Commenter 3
18Commenter 18
The code looks ugly:
+  if (Precision::IsInfinite (aUmin))
+    aUmin = Max (aUmin, -theUVLimit);

It should be changed so:
+  if (Precision::IsInfinite (aUmin))
+    aUmin = -theUVLimit;


The test bugs/modalg_7/bug29356_1 seems to repeat the new script v3d/face/G2. Please remove duplicate.
19Commenter 2
Branch [archived branch] has been updated by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Wed Mar 7 10:11:32 2018 +0300

    # correcting by the issue remarks: simplify code conditions, remove duplicated test case

20Commenter 2
Branch [archived branch] has been created by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Mon Jan 29 11:19:36 2018 +0300

    0029356: Modeling Algorithms - GCPnts_TangentialDeflection hangs on specific curve
    
    While UV Iso parameters are obtained in StdPrs_Isolines, UV limits should be applied only if face bounds has infinite values.
    In the issue case, the UV values are greater than UVLimits and not infinite. This fix makes possible to have correct Iso lines in presentation without modification of UV limits beforehead.
21Commenter 2
Branch [archived branch] has been updated by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Wed Mar 7 14:38:05 2018 +0300

    # correcting test case to dump result without automatic fit view

22Commenter 2
Branch [archived branch] has been updated by Commenter 3.

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Wed Mar 7 15:02:23 2018 +0300

    # correcting test case to dump result without automatic fit view

23Commenter 3
24Commenter 24
Reviewed.
25Commenter 1
Combination -
OCCT branch : [archived branch] SHA - [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:
Debian70-64:
OCCT
Total CPU difference: 18309.269999999546 / 18338.37999999957 [-0.16%]
Products
Total CPU difference: 7488.200000000005 / 7461.340000000009 [+0.36%]
Windows-64-VC10:
OCCT
Total CPU difference: 17709.264720198506 / 17653.338361698563 [+0.32%]
Products
Total CPU difference: 8014.644975599993 / 7990.761222500007 [+0.30%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
26Commenter 2
Branch [archived branch] has been deleted by Author.

[revision removed]
27Commenter 2
Branch [archived branch] has been deleted by Author.

[revision removed]
28Commenter 2
Branch [archived branch] has been deleted by Author.

[revision removed]
29Commenter 2
Branch [archived branch] has been deleted by Author.

[revision removed]