DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0030829

BRepExtrema_ShapeProximity crashes with shape from STL/WRL

CommunityOCCT:Modeling Algorithmsclosed8 public notes

Search issues

Description

BRepExtrema_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 reproduce

Any proximity check with shapes that don't have topological information but only meshed triangles

test bugs modalg_7 bug30829

Additional information

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.

Public activity

8 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


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.
02Commenter 2
03Commenter 3
No remarks.

Although filling myVertexArray.push_back()/myTriangles.push_back() without pre-pass resizing arrays looks strange.
04Commenter 4
Test bug30829 does not pass.
05Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
06Commenter 6
Test case corrected.
07Commenter 1
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: 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
08Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records