MantisBT - Community
View Issue Details
0026965Community[OCCT] OCCT:Meshpublic2015-12-08 14:092018-11-11 12:01
Istvan Csanady 
bugmaster 
normalminor 
verifiedfixed 
 
[OCCT] 7.4.0 
perf/mesh/bug26965
0026965: BRepMesh_IncrementalMesh hangs, and consumes infinite memory
For swept shapes like the attached one, BRepMesh_IncrementalMesh quite often hangs (forever) and constantly allocates more and more memory (7-30MB/sec)

These shapes are created with BRepOffsetAPI_MakePipe, by sweeping an arbitrary profile through a wavy BSpline.
#Load the attached shape with DRAWEXE.

restore mesh_hang.brep a
tclean a
vinit
vsetdispmode 1
vdisplay a
This is probably related to 0026889
No tags attached.
related to 0027693verified bugmaster Open CASCADE BRepMesh: fine edge tessellation leads to excess number of triangles along the whole U or V stripes 
has duplicate 0026889verified bugmaster Community Very poor mesh result from shape 
related to 0026106verified bugmaster Open CASCADE BRepMesh - revision of data model 
? mesh_hang.brep (338,432) 2015-12-08 14:09
https://tracker.dev.opencascade.org/
png elbow_1.png (54,317) 2016-02-08 15:14
https://tracker.dev.opencascade.org/
png elbow_2.png (86,866) 2016-02-08 15:14
https://tracker.dev.opencascade.org/
Issue History
2015-12-08 14:09Istvan CsanadyNew Issue
2015-12-08 14:09Istvan CsanadyAssigned To => oan
2015-12-08 14:09Istvan CsanadyFile Added: mesh_hang.brep
2016-02-02 11:07abvTarget Version7.0.0 => 7.1.0
2016-02-08 14:06oanRelationship addedhas duplicate 0026889
2016-02-08 14:17oanRelationship addedrelated to 0023513
2016-02-08 15:14oanFile Added: elbow_1.png
2016-02-08 15:14oanFile Added: elbow_2.png
2016-02-08 15:14oanNote Added: 0050481
2016-02-08 15:14oanAssigned Tooan => Istvan Csanady
2016-02-08 15:14oanStatusnew => feedback
2016-02-09 05:32Istvan CsanadyNote Added: 0050504
2016-02-09 09:25abvNote Added: 0050506
2016-02-09 10:41oanNote Added: 0050509
2016-03-10 15:48Istvan CsanadyNote Added: 0051522
2016-03-10 15:57abvNote Added: 0051523
2016-03-10 15:57abvAssigned ToIstvan Csanady => oan
2016-03-10 15:57abvStatusfeedback => assigned
2016-10-25 17:43oanRelationship addedrelated to 0027693
2016-10-25 17:45oanTarget Version7.1.0 => 7.2.0
2016-11-01 13:53oanRelationship addedrelated to 0026106
2017-07-20 12:43oanTarget Version7.2.0 => 7.3.0
2017-08-11 12:59oanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17303#r17303
2017-08-11 13:05oanNote Added: 0069316
2018-02-25 21:14abvTarget Version7.3.0 => 7.4.0
2018-11-02 15:25nbvNote Added: 0080632
2018-11-02 15:26nbvAssigned Tooan => bugmaster
2018-11-02 15:26nbvStatusassigned => feedback
2018-11-02 18:49msvNote Added: 0080665
2018-11-02 18:50msvAssigned Tobugmaster => oan
2018-11-02 18:50msvStatusfeedback => assigned
2018-11-02 19:00oanAssigned Tooan => nbv
2018-11-02 19:00oanStatusassigned => feedback
2018-11-06 14:41abvNote Added: 0080748
2018-11-06 14:49gitNote Added: 0080749
2018-11-07 13:44gitNote Added: 0080821
2018-11-07 17:12gitNote Added: 0080856
2018-11-07 17:44gitNote Added: 0080875
2018-11-07 18:07nbvNote Added: 0080891
2018-11-07 18:07nbvAssigned Tonbv => msv
2018-11-07 18:07nbvStatusfeedback => resolved
2018-11-08 09:41msvNote Added: 0080908
2018-11-08 09:41msvAssigned Tomsv => bugmaster
2018-11-08 09:41msvStatusresolved => reviewed
2018-11-08 13:48bugmasterNote Added: 0080944
2018-11-08 13:48bugmasterStatusreviewed => tested
2018-11-09 15:44bugmasterTest case number => perf/mesh/bug26965
2018-11-11 11:52bugmasterChangeset attached => occt master 17412926
2018-11-11 11:52bugmasterStatustested => verified
2018-11-11 11:52bugmasterResolutionopen => fixed
2018-11-11 12:01gitNote Added: 0081033

Notes
(0050481)
oan   
2016-02-08 15:14   
Dear Istvan,

generally the problem with hanging of BRepMesh on such kind of shapes is connected with surface eversions on the elbows which can be observed on attached screenshots (elbow_1, elbow_2). BRepMesh's logic tries to produce mesh suitable for visualization, i.e. it tries to prevent occurence of dark areas which are caused by strong deviation of normals at triangle vertices. In this case it generates additional points, thus generates more finier mesh. Considering the problematic areas on elbows, algorithm could insert a lot of points in order to gain the suitable quality of a result. However, existing drastic bend can lead to unconditional division without achieving the desired result.

In order to prevent such behavior you can disable procedure of addition of new vertices at all by using -surf_def_off parameter or specify minimum size parameter in order to limit mesh amplification. E.g. the following command produces mesh without hanging:

incmesh a 0.1 -min 0.1

Best regards,
Oleg.
(0050504)
Istvan Csanady   
2016-02-09 05:32   
Wow, thanks Oleg, that helped! Works like a charm.
(0050506)
abv   
2016-02-09 09:25   
Oleg, can we add some default restriction against insertion of infinite number of points? I suppose this can be made either restricting number of iterations or setting some default value for this parameter "-min".
(0050509)
oan   
2016-02-09 10:41   
Andrey, yes we can. In fact, there is an issue #23513 that supposes this restriction and now it should be tested and vertified.
(0051522)
Istvan Csanady   
2016-03-10 15:48   
For me that works, it can be closed (just because the ticket is in waiting for feedback state)
(0051523)
abv   
2016-03-10 15:57   
Oleg, please consider this issue together with #23513 (as one more test case)
(0069316)
oan   
2017-08-11 13:05   
Performance could be improved by 0026106 patch.
(0080632)
nbv   
2018-11-02 15:25   
Fixed in frame of 0026106 or children.
(0080665)
msv   
2018-11-02 18:49   
I think we should create a test case and close it.
(0080748)
abv   
2018-11-06 14:41   
In my test, vdisplay took ~ 7 sec
(0080749)
git   
2018-11-06 14:49   
Branch CR26965 has been created by nbv.

SHA-1: d37830f4a1f6dd4f18bb1fb94c27475e04deac75


Detailed log of new commits:

Author: nbv
Date: Tue Nov 6 14:46:15 2018 +0300

    0026965: BRepMesh_IncrementalMesh hangs, and consumes infinite memory
    
    Only test case has been created.
(0080821)
git   
2018-11-07 13:44   
Branch CR26965 has been updated forcibly by nbv.

SHA-1: 75b8da9d59474a53d0640f29d6e44f7f4fd1edaf
(0080856)
git   
2018-11-07 17:12   
Branch CR26965 has been updated forcibly by nbv.

SHA-1: 7eb49de429270bc68d4c6ed17d8bcdb171daaabd
(0080875)
git   
2018-11-07 17:44   
Branch CR26965 has been updated forcibly by nbv.

SHA-1: 0e5fb019d9a2cdf1db3a40ca1a927c3646af15f7
(0080891)
nbv   
2018-11-07 18:07   
Dear Mikhail,

Please review the branch CR26965.

Test results are here:
Windows: http://jenkins-test-12.nnov.opencascade.com/view/MeshTest-master_NBV/view/TESTING/job/MeshTest-master_NBV-OCCT-Windows-64-VC14-opt-test-restart/HTML_20Report/ [^]

Linux: http://jenkins-test-12.nnov.opencascade.com/view/MeshTest-master_NBV/view/TESTING/job/MeshTest-master_NBV-OCCT-Debian80-64-opt-test-restart/HTML_20Report/ [^]
(0080908)
msv   
2018-11-08 09:41   
Reviewed.
(0080944)
bugmaster   
2018-11-08 13:48   
Adding test case
(0081033)
git   
2018-11-11 12:01   
Branch CR26965 has been deleted by inv.

SHA-1: 0e5fb019d9a2cdf1db3a40ca1a927c3646af15f7