MantisBT - Community
View Issue Details
0030829Community[OCCT] OCCT:Modeling Algorithmspublic2019-07-03 13:552019-07-20 11:56
NCSrl 
bugmaster 
normalcrash 
closedfixed 
WindowsVC++ 201564 bit
[OCCT] 6.9.0 
[OCCT] 7.4.0[OCCT] 7.4.0 
bugs/modalg_7/bug30829
0030829: BRepExtrema_ShapeProximity crashes with shape from STL/WRL
BRepExtrema_ShapeProximity() method crashes when I try to use shapes that are loaded from stl or wrl files.
It works well with IGES/STEP.
Any proximity check with shapes that don't have topological information but only meshed triangles

test bugs modalg_7 bug30829
I have check the involved classes and there are 3 steps that needs topological information to be executed. The meshed object loaded from stl and wrl don't have this information and the classes crashes.
In particular there are 3 classes involved :
BRepExtrema_ShapeProximity, BRepExtrema_TriangleSet and BRepExtrema_OverlapTool.

The crash is in BRepExtrema_TriangleSet::Init() method called from BRepExtrema_ShapeProximity.
The crash can be avoid by commenting the line :
//BRepAdaptor_Surface aFaceAdaptor (theFaces (aFaceIdx), Standard_False);
N.B. aFaceAdaptor is never used in this method !!!

and 3 other lines:

//const Standard_Real aU = aTriangulation->UVNodes().Value (aVertIdx).X();
//const Standard_Real aV = aTriangulation->UVNodes().Value (aVertIdx).Y();

//myVertUVArray.push_back (BVH_Vec2d (aU, aV));
N.B. loading myVertUVArray is not mandatory.

By doing these changes the BRepExtrema_ShapeProximity() class can check proximity also for stl and wrl files.

I attach the modified class that I have used to check the right working.
No tags attached.
related to 0028125new msv Open CASCADE Modeling Algorithms - support of BRep shapes based on tessellated geometry 
cxx BRepExtrema_TriangleSetNC.cxx (8,527) 2019-07-03 13:55
https://tracker.dev.opencascade.org/
Issue History
2019-07-03 13:55NCSrlNew Issue
2019-07-03 13:55NCSrlAssigned To => NCSrl
2019-07-03 13:55NCSrlFile Added: BRepExtrema_TriangleSetNC.cxx
2019-07-17 16:13msvRelationship addedrelated to 0028125
2019-07-17 16:47msvAssigned ToNCSrl => msv
2019-07-17 16:47msvStatusnew => assigned
2019-07-17 16:52gitNote Added: 0085707
2019-07-17 16:54msvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=21527#r21527
2019-07-17 16:56msvNote Added: 0085709
2019-07-17 16:56msvAssigned Tomsv => kgv
2019-07-17 16:56msvStatusassigned => resolved
2019-07-17 17:42kgvNote Added: 0085713
2019-07-17 17:42kgvAssigned Tokgv => bugmaster
2019-07-17 17:42kgvStatusresolved => reviewed
2019-07-17 17:42kgvTarget Version => 7.4.0
2019-07-17 17:44kgvRelationship addedchild of 0025398
2019-07-17 17:44kgvProduct Version7.3.0 => 6.9.0
2019-07-17 18:17msvNote Added: 0085716
2019-07-17 18:17msvAssigned Tobugmaster => msv
2019-07-17 18:17msvStatusreviewed => assigned
2019-07-17 18:23gitNote Added: 0085717
2019-07-17 19:04msvNote Added: 0085719
2019-07-17 19:04msvStatusassigned => resolved
2019-07-17 19:04msvAssigned Tomsv => bugmaster
2019-07-17 19:04msvStatusresolved => reviewed
2019-07-17 20:09bugmasterTest case number => bugs/modalg_7/bug30829
2019-07-17 20:10bugmasterNote Added: 0085725
2019-07-17 20:10bugmasterStatusreviewed => tested
2019-07-20 11:42bugmasterChangeset attached => occt master 7c08e3ac
2019-07-20 11:42bugmasterStatustested => verified
2019-07-20 11:42bugmasterResolutionopen => fixed
2019-07-20 11:56gitNote Added: 0085846

Notes
(0085707)
git   
2019-07-17 16:52   
Branch CR30829 has been created by msv.

SHA-1: e9789a532fcd35d70b12ce24ba9f2025a81c207f


Detailed log of new commits:

Author: msv
Date: Wed Jul 17 16:50:43 2019 +0300

    0030829: BRepExtrema_ShapeProximity crashes with shape from STL/WRL
    
    The fix makes algorithm independent on geometrical data. Only triangulation is needed for its work.
(0085709)
msv   
2019-07-17 16:56   
Please review.

http://jenkins-test-12.nnov.opencascade.com/view/CR30829-master-MSV/view/COMPARE/ [^]
(0085713)
kgv   
2019-07-17 17:42   
No remarks.

Although filling myVertexArray.push_back()/myTriangles.push_back() without pre-pass resizing arrays looks strange.
(0085716)
msv   
2019-07-17 18:17   
Test bug30829 does not pass.
(0085717)
git   
2019-07-17 18:23   
Branch CR30829 has been updated forcibly by msv.

SHA-1: b8c42dc3bfd8b9f4c4ee27dd74349d5f074956cc
(0085719)
msv   
2019-07-17 19:04   
Test case corrected.
(0085725)
bugmaster   
2019-07-17 20:10   
Combination -
OCCT branch : CR30829
master SHA - e9789a532fcd35d70b12ce24ba9f2025a81c207f
32ce09545dc9c46a47a51a964a24b1f472e6c2c4
Products branch : master SHA - ce8f14216a548db739b749891b6f800b0d5c6e8b
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: 10675.620000000086 / 10681.040000000101 [-0.05%]
Products
---
Windows-64-VC14:
OCCT
Total CPU difference: 17644.9375 / 17623.078125 [+0.12%]
Products
Total CPU difference: 12086.46875 / 12058.53125 [+0.23%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0085846)
git   
2019-07-20 11:56   
Branch CR30829 has been deleted by inv.

SHA-1: b8c42dc3bfd8b9f4c4ee27dd74349d5f074956cc