Archived issue #0026965

BRepMesh_IncrementalMesh hangs, and consumes infinite memory

CommunityOCCT:Meshclosed18 public notes

Search issues

Description

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.

Steps to reproduce

#Load the attached shape with DRAWEXE.

restore Attachment 3 (BREP) a
tclean a
vinit
vsetdispmode 1
vdisplay a

Additional information

This is probably related to #0026889

Public activity

18 archived notes

Participants are labeled by their role within this record.

01Commenter 2
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

[signature removed]
Oleg.
02Author
Wow, thanks Oleg, that helped! Works like a charm.
03Commenter 3
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".
04Commenter 2
Andrey, yes we can. In fact, there is an issue #23513 that supposes this restriction and now it should be tested and vertified.
05Author
For me that works, it can be closed (just because the ticket is in waiting for feedback state)
06Commenter 6
Oleg, please consider this issue together with #23513 (as one more test case)
07Commenter 2
Performance could be improved by #0026106 patch.
08Commenter 8
Fixed in frame of #0026106 or children.
09Commenter 9
I think we should create a test case and close it.
10Commenter 10
In my test, vdisplay took ~ 7 sec
11Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


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.
12Commenter 3
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
13Commenter 3
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
14Commenter 3
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
15Commenter 15
16Commenter 16
Reviewed.
17Commenter 1
Adding test case
18Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records