MantisBT - Community
View Issue Details
0023650Community[OCCT] OCCT:Modeling Algorithmspublic2012-12-18 20:222013-12-19 13:58
jeromerobert 
bugmaster 
normalminor 
closedfixed 
ALL
[OCCT] 6.5.4 
[OCCT] 6.7.0[OCCT] 6.7.0 
bugs mesh bug23650
0023650: Slow mesher: one bspline surface, 80 seconds for 132 triangles
Meshing the attached one surface brep with:

    BRepTools::Clean(face);
    BRepMesh_IncrementalMesh(face, 5, false);

last for 80 seconds to create 132 triangles.

Can be reproduced with OCCT 6.5.3 and 6.5.4 (I've not tested with older versions)
No tags attached.
parent of 0024268closed bugmaster Open CASCADE Wrong triangulation on the boundaries of the cones 
? slowmesh.brep (9,595) 2012-12-18 20:22
https://tracker.dev.opencascade.org/
Issue History
2012-12-18 20:22jeromerobertNew Issue
2012-12-18 20:22jeromerobertAssigned To => oan
2012-12-18 20:22jeromerobertFile Added: slowmesh.brep
2013-06-06 23:12abvNote Added: 0024680
2013-06-06 23:12abvAssigned Tooan => ifv
2013-06-06 23:12abvStatusnew => assigned
2013-06-13 10:48oanNote Added: 0024740
2013-06-13 10:49oanStatusassigned => resolved
2013-06-28 18:56ifvNote Added: 0024917
2013-06-28 18:56ifvStatusresolved => feedback
2013-07-01 10:42ifvNote Edited: 0024917bug_revision_view_page.php?bugnote_id=24917#r5586
2013-07-01 10:43ifvAssigned Toifv => oan
2013-07-15 14:51oanNote Added: 0025063
2013-07-15 14:51oanCategoryOCCT:Mesh => OCCT:Modeling Algorithms
2013-07-15 14:51oanAssigned Tooan => ifv
2013-07-15 14:52oanStatusfeedback => assigned
2013-09-26 14:34ifvAssigned Toifv => aml
2013-10-04 14:29amlNote Added: 0025896
2013-10-04 14:29amlAssigned Toaml => ifv
2013-10-04 14:29amlStatusassigned => resolved
2013-10-08 10:09ifvNote Added: 0025950
2013-10-08 10:09ifvStatusresolved => feedback
2013-10-08 10:26amlAssigned Toifv => aml
2013-10-08 12:19amlNote Added: 0025953
2013-10-08 12:19amlAssigned Toaml => ifv
2013-10-08 12:19amlStatusfeedback => resolved
2013-10-08 13:29ifvNote Added: 0025956
2013-10-08 13:29ifvStatusresolved => reviewed
2013-10-08 15:00mkvAssigned Toifv => apn
2013-10-09 11:19apnNote Added: 0025984
2013-10-09 11:20apnTest case number => bugs mesh bug23650
2013-10-09 11:20apnAssigned Toapn => aml
2013-10-09 11:20apnStatusreviewed => assigned
2013-10-10 15:43amlNote Added: 0026026
2013-10-10 15:43amlAssigned Toaml => ifv
2013-10-10 15:43amlStatusassigned => resolved
2013-10-10 17:12ifvNote Added: 0026034
2013-10-10 17:12ifvStatusresolved => reviewed
2013-10-11 07:18mkvAssigned Toifv => mkv
2013-10-15 11:09apnNote Added: 0026079
2013-10-15 11:10apnAssigned Tomkv => bugmaster
2013-10-15 11:10apnStatusreviewed => tested
2013-10-15 11:10apnTarget Version => 6.7.0
2013-10-15 11:19abvNote Added: 0026080
2013-10-15 11:19abvAssigned Tobugmaster => mkv
2013-10-15 11:19abvStatustested => feedback
2013-10-15 11:40apnNote Added: 0026081
2013-10-15 11:41apnAssigned Tomkv => abv
2013-10-15 11:46abvNote Added: 0026082
2013-10-15 11:46abvAssigned Toabv => bugmaster
2013-10-15 11:46abvStatusfeedback => tested
2013-10-18 11:49apnRelationship addedparent of 0024268
2013-10-18 13:47bugmasterChangeset attached => occt master 2b21c641
2013-10-18 13:47bugmasterStatustested => verified
2013-10-18 13:47bugmasterResolutionopen => fixed
2013-12-19 13:51bugmasterStatusverified => closed
2013-12-19 13:58bugmasterFixed in Version => 6.7.0

Notes
(0024680)
abv   
2013-06-06 23:12   
The problem looks as having similar nature to 0023706, according to the fix made in OCE for this:
https://github.com/jeromerobert/oce/commit/58f9f0a527899f66817b98ceea278a0c5ff74fad [^]
(0024740)
oan   
2013-06-13 10:48   
Dear Andrey, dear Igor,

The problem occurs because the boundary of the given surface is much bigger than step for exploring along the chosen iso line. This step is being defined by using a "magic" number:

Standard_Real L = .001;
h = Min(L/sqrt(MDV), hmax);

Thus, when MDV is too small in case of surfaces with small curvature and boundary of this surface is big enough, a step defined in such way is always shorter than hmax and as a result it hangs the program during stepping along the iso line using this value.

As the solution I suppose using size of surface instead of constant value 0.001 for calculation of appropriate step.

Please review the fix placed at git branch CR23650.
(0024917)
ifv   
2013-06-28 18:56   
(edited on: 2013-07-01 10:42)
Dear oan,
in expression
h = Min(L/sqrt(MDV), hmax)
hmax and h are parametric distances, but L is distance in 3D space.
When we use L=last-first, it has no physical sence.
I think it is better to restric number of steps for small h.
May be expression h = Min(...) is mistake and it is better to use
h = Max(L/sqrt(MDV), hmax), so h >= hmax always.

(0025063)
oan   
2013-07-15 14:51   
Dear Igor,

So, I see the problem needs more thorough analysis and as far as it's out of BRepMesh scope, I move it to Modeling Algorithms category and assign it to you.

Please manage.
(0025896)
aml   
2013-10-04 14:29   
Dear ifv,
Please, test the current state of branch CR23650_2 to be sure it is still ok.

Since attached mesh have big physical size, avoid to use "incmesh mesh 0.1", try to use "incmesh mesh 0.2". Also i checked my code with cone and sphere, it seems to be ok.



(0025950)
ifv   
2013-10-08 10:09   
It is better to use CSLib::Normal(...) including second derivatives of S
(0025953)
aml   
2013-10-08 12:19   
Dear ifv,
I implemented your suggestions. Please, test the current state of branch CR23650_2 to be sure it is still ok.

(0025956)
ifv   
2013-10-08 13:29   
OK
(0025984)
apn   
2013-10-09 11:19   
Dear BugMaster,

Branch CR23650_2 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 8e55481a84d7e74b2eac1b47790cbeef622238f0

Number of compiler warnings:

occt component :
Linux: 424 (424 on master)
Windows: 9 (9 on master)

products component :
Linux: 189 (189 on master)
Windows: 287 (287 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
bugs mesh bug23650 - OK

Testing on Linux:
Total MEMORY difference: 367125272 / 367286876
Total CPU difference: 43952.54000000102 / 44591.450000001256

Testing on Windows:
Total MEMORY difference: 432900964 / 433093372
Total CPU difference: 36985.09375 / 41200.890625

There are differences in images found by testdiff (lost triangle on the tops of shapes):
http://occt-tests/CR23650-2-master-occt/Debian60-64/diff-Debian60-64.html [^]
http://occt-tests/CR23650-2-master-occt/Windows-32-VC9/diff-Windows-32-VC9.html [^]
bugs vis bug20373
bugs vis bug288_1
bugs vis bug288_4
bugs vis bug331
bugs vis bug331
bugs vis bug288_10
bugs vis bug591
bugs vis bug331_1
bugs xde bug22535_1
bugs xde bug22535_2
bugs modalg_2 bug291
etc...
(0026026)
aml   
2013-10-10 15:43   
Dear ifv,
I improved solution in case of null normal, please re-check branch CR23650_2 to be sure it is still ok.

I deleted
 if (aStatus == CSLib_Defined) {...}
because we cannot get this status in choosed Norm() function.
        
(0026034)
ifv   
2013-10-10 17:12   
Ok
(0026079)
apn   
2013-10-15 11:09   
Dear BugMaster,

Branch CR23650_2 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 284a8f07ae3e83cf72999d0ff42e760a9becb7d5

Number of compiler warnings:

occt component :
Linux: 370 (370 on master)
Windows: 6 (6 on master)

products component :
Linux: 191 (191 on master)
Windows: 287 (287 on master)

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
bugs mesh bug23650 - OK

Testing on Linux:
Total MEMORY difference: 353173520 / 353441772
Total CPU difference: 43357.99000000055 / 43492.680000000975

Testing on Windows:
Total MEMORY difference: 407467248 / 411331344
Total CPU difference: 30603.109375 / 37715.796875

There are not differences in images found by testdiff.
(0026080)
abv   
2013-10-15 11:19   
Please report current time of meshing of the original face (and number of triangles produced), to confirm that original problem (performance) is solved
(0026081)
apn   
2013-10-15 11:40   
Meshing the original face on Linux:
Draw[1]> incmesh result 5
Elapsed time: 0 Hours 0 Minutes 0.002081 Seconds
CPU user time: 0 seconds
CPU system time: 0 seconds

Draw[2]> trinfo result
This shape contains 134 triangles.
                    73 nodes.
Maximal deflection 2.6992547745561875

Meshing the original face on WNT:
Draw[1]> incmesh result 5
Elapsed time: 0 Hours 0 Minutes 0.00793472561054 Seconds
CPU user time: 0 seconds
CPU system time: 0 seconds

Draw[2]> trinfo result
This shape contains 134 triangles.
                    73 nodes.
Maximal deflection 2.6992547745561875
(0026082)
abv   
2013-10-15 11:46   
Thank you!