MantisBT - Community
View Issue Details
0027087Community[OCCT] OCCT:Modeling Algorithmspublic2016-01-18 15:442020-05-16 14:21
BenjaminBihler 
bugmaster 
highminor 
verifiedfixed 
WindowsVC++ 201232bit
[OCCT] 7.0.0 
[OCCT] 7.5.0 
bugs/modalg_7/bug27087
0027087: [Regression to OCCT 6.7.1] BRepExtrema_DistShapeShape gives wrong result
I have an example where an edge pierces through a shell, but BRepExtrema_DistShapeShape states the distance was 0.00760306. This is definitely wrong, the distance is zero.

It seems as if such errors happened especially, if an edge pierces through another edge with is the boundary of a face of the shell.
Test case

bugs modalg_7 bug27087

Test uses input file bug27087.brep (attached)
No tags attached.
? Distance.stp (229,973) 2016-01-18 15:44
https://tracker.dev.opencascade.org/
? bug27087.brep (9,221,501) 2016-05-09 11:44
https://tracker.dev.opencascade.org/
Issue History
2016-01-18 15:44BenjaminBihlerNew Issue
2016-01-18 15:44BenjaminBihlerAssigned To => abv
2016-01-18 15:44BenjaminBihlerFile Added: Distance.stp
2016-01-18 15:56abvAssigned Toabv => msv
2016-01-18 15:56abvCategoryOCCT:Foundation Classes => OCCT:Modeling Algorithms
2016-05-09 10:08BenjaminBihlerNote Added: 0053915
2016-05-09 11:44abvFile Added: bug27087.brep
2016-05-09 11:49abvNote Added: 0053916
2016-05-09 11:50abvNote Edited: 0053916bug_revision_view_page.php?bugnote_id=53916#r13669
2016-05-10 09:41msvAssigned Tomsv => aml
2016-05-10 09:41msvStatusnew => assigned
2016-05-10 14:54msvSummaryBRepExtrema_DistShapeShape gives wrong result => [Regression to OCCT 6.7.1] BRepExtrema_DistShapeShape gives wrong result
2016-05-10 15:02amlNote Added: 0053951
2016-07-01 06:14David AustinNote Added: 0055625
2016-10-28 16:32msvTarget Version7.1.0 => 7.2.0
2017-07-21 11:34msvTarget Version7.2.0 => 7.3.0
2017-10-09 11:39abvPrioritynormal => high
2017-12-05 17:08msvTarget Version7.3.0 => 7.4.0
2019-08-12 16:37msvTarget Version7.4.0 => 7.5.0
2019-09-02 16:13msvAssigned Toaml => ifv
2019-09-02 16:13msvTarget Version7.5.0 => 7.4.0
2019-09-03 15:52gitNote Added: 0086692
2019-09-05 12:30gitNote Added: 0086790
2019-09-06 15:33gitNote Added: 0086889
2019-09-06 15:35gitNote Added: 0086890
2019-09-09 14:58gitNote Added: 0086982
2019-09-10 16:51gitNote Added: 0086992
2019-09-17 17:51gitNote Added: 0087212
2019-09-20 17:16gitNote Added: 0087372
2019-09-25 22:08abvTarget Version7.4.0 => 7.5.0
2019-09-27 17:20gitNote Added: 0087580
2019-09-30 17:21gitNote Added: 0087641
2020-02-28 11:11gitNote Added: 0090715
2020-02-28 11:13gitNote Added: 0090716
2020-03-02 15:16gitNote Added: 0090765
2020-03-03 15:45gitNote Added: 0090798
2020-03-05 16:30gitNote Added: 0090838
2020-03-13 15:16gitNote Added: 0090928
2020-03-23 15:02gitNote Added: 0091197
2020-03-24 12:34gitNote Added: 0091211
2020-03-24 15:55ifvNote Added: 0091220
2020-03-24 15:55ifvAssigned Toifv => msv
2020-03-24 15:55ifvStatusassigned => resolved
2020-03-24 15:55ifvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=22719#r22719
2020-03-26 14:40msvNote Added: 0091270
2020-03-26 14:40msvAssigned Tomsv => ifv
2020-03-26 14:40msvStatusresolved => assigned
2020-04-14 17:11gitNote Added: 0091546
2020-04-14 17:34gitNote Added: 0091547
2020-04-15 18:10gitNote Added: 0091560
2020-04-16 13:31gitNote Added: 0091590
2020-04-16 16:10gitNote Added: 0091595
2020-04-17 08:36gitNote Added: 0091604
2020-04-17 10:35ifvNote Added: 0091612
2020-04-17 10:35ifvAssigned Toifv => msv
2020-04-17 10:35ifvStatusassigned => resolved
2020-05-12 18:24gitNote Added: 0092076
2020-05-12 18:26ifvAssigned Tomsv => ifv
2020-05-12 18:26ifvStatusresolved => assigned
2020-05-13 08:49ifvNote Added: 0092082
2020-05-13 08:49ifvAssigned Toifv => jgv
2020-05-13 08:49ifvStatusassigned => resolved
2020-05-14 09:15emvNote Added: 0092098
2020-05-14 09:22gitNote Added: 0092099
2020-05-14 09:25ifvNote Added: 0092101
2020-05-14 11:11jgvNote Added: 0092104
2020-05-14 11:11jgvAssigned Tojgv => bugmaster
2020-05-14 11:11jgvStatusresolved => reviewed
2020-05-15 11:08bugmasterNote Added: 0092130
2020-05-15 11:08bugmasterStatusreviewed => tested
2020-05-15 11:09bugmasterTest case number => bugs/modalg_7/bug27087
2020-05-16 14:07bugmasterChangeset attached => occt master 79aa9b5c
2020-05-16 14:07bugmasterStatustested => verified
2020-05-16 14:07bugmasterResolutionopen => fixed
2020-05-16 14:21gitNote Added: 0092182

Notes
(0053915)
BenjaminBihler   
2016-05-09 10:08   
I have tried the following to spot the error:
- played with BRepExtrema_DistShapeShape deflection values -> nothing changes
- changed the BRepExtrema_DistShapeShape algorithm -> nothing changes
- computed the distance of connectingEdge in my example code to every face and every edge of shellSurface -> I get no smaller value than 0.00760306

Therefore it seems to me, that BRepExtrema_DistShapeShape really computes the point pair with minimum distance, but somehow they are not computed precise enough. It misses the real minimum a little bit.

Is there anything more I can do to support your search for this error?
(0053916)
abv   
2016-05-09 11:49   
(edited on: 2016-05-09 11:50)
I confirm the problem (also tested in OCCT 6.8, 6.9.1). Here are steps to reproduce in DRAW (use file bug27087 attached):

pload MODELING
restore [locate_data_file bug27087.brep] a
explode a
distmini r a_1 a_2
if { [dval r_val] > 0.0001 } { puts "Error: too big deviation, should be 0!" }

The reported distance 0.0076 is actually the value computed between a_1 and boundary edge of a_2.
To see that curve (a_1, geometrically a line) actually does intersect a face (a_2, 20-th face from original model), show it in viewer and zoom:

pload VISUALIZATION
incmesh a 0.001
vdisplay a

(0053951)
aml   
2016-05-10 15:02   
The problem is inside of extrema Curve / Surface algorithm which does not take into account surface / curve complexity.
Number of samples is always 10 or 13 (for line curve too - 10 samples, instead of 3).

The proposed solution is to make number of samples adaptive according to the objects complexity.

This case is regression to 6.7.1.
(0055625)
David Austin   
2016-07-01 06:14   
I have this issue too. Sphere to shape distances that should be reported as
zero are reported as a (random) small positive number.
(0086692)
git   
2019-09-03 15:52   
Branch CR27087 has been created by ifv.

SHA-1: 1d51d5e1e43832834943f5c0a402aef633db6510


Detailed log of new commits:

Author: ifv
Date: Tue Sep 3 15:48:24 2019 +0300

    0027087: [Regression to OCCT 6.7.1] BRepExtrema_DistShapeShape gives wrong result
    
    Extrema_ExtCs.cxx: adaptive choice of samples is implemented;
    Test case added.
(0086790)
git   
2019-09-05 12:30   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: c03da185831e611bae31180db29563eba625e2b3
(0086889)
git   
2019-09-06 15:33   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: 312382b0282f34e357524d0dd747c22def3a1bfc
(0086890)
git   
2019-09-06 15:35   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: cb50503a247f1f57d5ccdd258d9c8d080e3a239d
(0086982)
git   
2019-09-09 14:58   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: d6a7073af908d98e3ba957b7d8a154a7deee1b56
(0086992)
git   
2019-09-10 16:51   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: 0499e7ae5a604f0f45bb0d7d1c8dcbddbe86c199
(0087212)
git   
2019-09-17 17:51   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: b7955a54e10d16d68363f4d82ed0e0d57b2cafaf
(0087372)
git   
2019-09-20 17:16   
Branch CR27087 has been updated by ifv.

SHA-1: 69ac71d8bd375bddf1f3d223ced87535f06cd2e0


Detailed log of new commits:

Author: ifv
Date: Fri Sep 20 17:12:21 2019 +0300

    Fix regressions 2

(0087580)
git   
2019-09-27 17:20   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: c92827306becaf34b99860b3424f6a5fa1f42871
(0087641)
git   
2019-09-30 17:21   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: b5787631f5745191fc12720ef91852920e6ef944
(0090715)
git   
2020-02-28 11:11   
Branch CR27087 has been deleted by ifv.

SHA-1: b5787631f5745191fc12720ef91852920e6ef944
(0090716)
git   
2020-02-28 11:13   
Branch CR27087 has been created by ifv.

SHA-1: 49d85cf62d69535f7557019314573d750859939c


Detailed log of new commits:

Author: ifv
Date: Tue Sep 3 15:48:24 2019 +0300

    0027087: [Regression to OCCT 6.7.1] BRepExtrema_DistShapeShape gives wrong result
    
    Extrema_ExtCs.cxx: adaptive choice of samples is implemented;
    Test case added.
(0090765)
git   
2020-03-02 15:16   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: db98ed14daee874765158afd0ecc42f38303fb05
(0090798)
git   
2020-03-03 15:45   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: 4d592111afc2b3258f4ccdd033ea74589e1f7bba
(0090838)
git   
2020-03-05 16:30   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: ab50c46942d7e34eb85f43c4de3db991c404507b
(0090928)
git   
2020-03-13 15:16   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: 6b8500cb17b9807cbd9e737b2d7cf74a53d3bb8f
(0091197)
git   
2020-03-23 15:02   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: 8695b2e2c881bfbfc226aec6e37e3a308287017a
(0091211)
git   
2020-03-24 12:34   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: 83e0dd298abb222c2fb20816ebc3f66ef9faea90
(0091220)
ifv   
2020-03-24 15:55   
Branch CR27087 is ready for review
(0091270)
msv   
2020-03-26 14:40   
I have put the attached shape into database (triangulation removed).

IMAGE bugs modalg_7 bug29900: bug29900.png differs
This difference seems to be a regression, like some sections becoming not computed. Could you analyze?

There are many regressions on performance. Can we avoid them?
CPU boolean bsection M8: 12.32 / 5.06 [+143.48%]
CPU boolean bsection N4: 515.27 / 269.91 [+90.90%]
CPU boolean bsection N5: 163.42 / 84.24 [+93.99%]
CPU boolean bsection M9: 33.9 / 13.85 [+144.77%]
CPU boolean bsection N6: 30.47 / 13.58 [+124.37%]
CPU boolean bsection N7: 269.8 / 126.59 [+113.13%]
CPU bugs modalg_7 bug27908: 3.2 / 0.87 [+267.82%]
CPU bugs modalg_6 bug28165_2: 9.33 / 3.73 [+150.13%]
CPU bugs modalg_6 bug27878_4: 29.59 / 14.01 [+111.21%]
(0091546)
git   
2020-04-14 17:11   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: 33a9ad8fa8d84b7d7599f696b8d02797e0523405
(0091547)
git   
2020-04-14 17:34   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: 0a5474cc6ae28098da9075f252ee2ccbf002744d
(0091560)
git   
2020-04-15 18:10   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: 0d9ab30151d49db7305fc6e3637b21a158b5e4ba
(0091590)
git   
2020-04-16 13:31   
Branch CR27087 has been updated by ifv.

SHA-1: 7f7e674729fa45bba211249a8fc5100900f4ece9


Detailed log of new commits:

Author: ifv
Date: Thu Apr 16 13:31:41 2020 +0300

    Revert all main changes

Author: ifv
Date: Thu Apr 16 10:45:06 2020 +0300

    Revert last commit

(0091595)
git   
2020-04-16 16:10   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: 708897d0b1b72a91aebcdabb95e5206495eef867
(0091604)
git   
2020-04-17 08:36   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: 6aa532fd6b29b0b21f134a702444e09593655ee4
(0091612)
ifv   
2020-04-17 10:35   
Branch CR27087 is ready for review
This patch fixes 29839 too.
(0092076)
git   
2020-05-12 18:24   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: a386f0d6fb0a67f25b5f8ccbde1ccea309aa7492
(0092082)
ifv   
2020-05-13 08:49   
Branch CR27087 is rebased on current
master and tested and ready for review
(0092098)
emv   
2020-05-14 09:15   
Sorry to interfere, I just noticed that the commit message does not correspond to the actual modifications:
Commit message states:
"tests/bugs/modalg_7/bug29580_1, tests/bugs/modalg_7/bug29900 : test are modified according to new behavior of algorithms"
While modified is only one test case: tests/bugs/modalg_5/bug25232_8
(0092099)
git   
2020-05-14 09:22   
Branch CR27087 has been updated forcibly by ifv.

SHA-1: 91445588c64eac58a304614a4b8647ec04228c82
(0092101)
ifv   
2020-05-14 09:25   
Thanks emv.
Commit message is updated according to actual state of commit.
(0092104)
jgv   
2020-05-14 11:11   
Reviewed.

Branches for integration:
OCCT – CR27087
Products – NOT
(0092130)
bugmaster   
2020-05-15 11:08   
Combination -
OCCT branch : WEEK-20
master SHA - d9eb6aca8789e6b8ff6742e3ad60a4dadf0cd37e
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : WEEK-20 SHA - eb85b0feb479f67f3a505bcb285922a288149f74
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: 17146.6200000001 / 17177.020000000186 [-0.18%]
Products
Total CPU difference: 11178.21000000009 / 11272.470000000078 [-0.84%]
Windows-64-VC14:
OCCT
Total CPU difference: 18609.671875 / 18646.015625 [-0.19%]
Products
Total CPU difference: 13007.71875 / 13180.21875 [-1.31%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0092182)
git   
2020-05-16 14:21   
Branch CR27087 has been deleted by inv.

SHA-1: 91445588c64eac58a304614a4b8647ec04228c82