View Issue Details

IDProjectCategoryView StatusLast Update
0030829CommunityOCCT:Modeling Algorithmspublic2019-07-20 11:56
ReporterNCSrl Assigned Tobugmaster  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2015 
Product Version6.9.0 
Target Version7.4.0Fixed in Version7.4.0 
Summary0030829: BRepExtrema_ShapeProximity crashes with shape from STL/WRL
DescriptionBRepExtrema_ShapeProximity() method crashes when I try to use shapes that are loaded from stl or wrl files.
It works well with IGES/STEP.
Steps To ReproduceAny proximity check with shapes that don't have topological information but only meshed triangles

test bugs modalg_7 bug30829
Additional information
and documentation updates
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.
TagsNo tags attached.
Test case numberbugs/modalg_7/bug30829

Attached Files

  • BRepExtrema_TriangleSetNC.cxx (8,527 bytes)

Relationships

related to 0028125 newmsv Open CASCADE Modeling Algorithms - support of BRep shapes based on tessellated geometry 

Activities

NCSrl

2019-07-03 13:55

reporter  

BRepExtrema_TriangleSetNC.cxx (8,527 bytes)

git

2019-07-17 16:52

administrator   ~0085707

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.

msv

2019-07-17 16:56

developer   ~0085709

Please review.

http://jenkins-test-12.nnov.opencascade.com/view/CR30829-master-MSV/view/COMPARE/

kgv

2019-07-17 17:42

developer   ~0085713

No remarks.

Although filling myVertexArray.push_back()/myTriangles.push_back() without pre-pass resizing arrays looks strange.

msv

2019-07-17 18:17

developer   ~0085716

Test bug30829 does not pass.

git

2019-07-17 18:23

administrator   ~0085717

Branch CR30829 has been updated forcibly by msv.

SHA-1: b8c42dc3bfd8b9f4c4ee27dd74349d5f074956cc

msv

2019-07-17 19:04

developer   ~0085719

Test case corrected.

bugmaster

2019-07-17 20:10

administrator   ~0085725

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

git

2019-07-20 11:56

administrator   ~0085846

Branch CR30829 has been deleted by inv.

SHA-1: b8c42dc3bfd8b9f4c4ee27dd74349d5f074956cc

Related Changesets

occt: master 7c08e3ac

2019-07-17 13:50:43

msv


Committer: bugmaster Details Diff
0030829: BRepExtrema_ShapeProximity crashes with shape from STL/WRL

The fix makes algorithm independent on geometrical data. Only triangulation is needed for its work.
Affected Issues
0030829
mod - src/BRepExtrema/BRepExtrema_TriangleSet.cxx Diff File
mod - src/BRepExtrema/BRepExtrema_TriangleSet.hxx Diff File
add - tests/bugs/modalg_7/bug30829 Diff File

Issue History

Date Modified Username Field Change
2019-07-03 13:55 NCSrl New Issue
2019-07-03 13:55 NCSrl Assigned To => NCSrl
2019-07-03 13:55 NCSrl File Added: BRepExtrema_TriangleSetNC.cxx
2019-07-17 16:13 msv Relationship added related to 0028125
2019-07-17 16:47 msv Assigned To NCSrl => msv
2019-07-17 16:47 msv Status new => assigned
2019-07-17 16:52 git Note Added: 0085707
2019-07-17 16:54 msv Steps to Reproduce Updated
2019-07-17 16:56 msv Note Added: 0085709
2019-07-17 16:56 msv Assigned To msv => kgv
2019-07-17 16:56 msv Status assigned => resolved
2019-07-17 17:42 kgv Note Added: 0085713
2019-07-17 17:42 kgv Assigned To kgv => bugmaster
2019-07-17 17:42 kgv Status resolved => reviewed
2019-07-17 17:42 kgv Target Version => 7.4.0
2019-07-17 17:44 kgv Product Version 7.3.0 => 6.9.0
2019-07-17 18:17 msv Note Added: 0085716
2019-07-17 18:17 msv Assigned To bugmaster => msv
2019-07-17 18:17 msv Status reviewed => assigned
2019-07-17 18:23 git Note Added: 0085717
2019-07-17 19:04 msv Note Added: 0085719
2019-07-17 19:04 msv Status assigned => resolved
2019-07-17 19:04 msv Assigned To msv => bugmaster
2019-07-17 19:04 msv Status resolved => reviewed
2019-07-17 20:09 bugmaster Test case number => bugs/modalg_7/bug30829
2019-07-17 20:10 bugmaster Note Added: 0085725
2019-07-17 20:10 bugmaster Status reviewed => tested
2019-07-20 11:42 bugmaster Changeset attached => occt master 7c08e3ac
2019-07-20 11:42 bugmaster Status tested => verified
2019-07-20 11:42 bugmaster Resolution open => fixed
2019-07-20 11:56 git Note Added: 0085846