MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0032261Community[OCCT] OCCT:Meshpublic2021-03-29 14:542021-04-16 16:00
Reporterdrazmyslovich 
Assigned Tooan 
PrioritynormalSeveritytrivial 
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version[OCCT] 7.6.0* 
Target Version[OCCT] 7.6.0*Fixed in Version 
Summary0032261: Mesh - some trivial improvements for mesher
DescriptionHi,

in course of investigating diverse meshing problems with different models I have produced several trivial code improvements in the context of meshing algorithm, which I would like to share here.

The improvements are the following:
1. BRepMesh_Delaun::isVertexInsidePolygon aTotalAng can be equal to -2 * M_PI, which still means 'inside'
2. BRepMesh_Delaun::decomposeSimplePolygon in case of anUsedLinkId == 3 the function always splits the polygon to one polygon with 2 links and the rest, which leads to additional memory allocations, while at the next iteration the first polygon is directly dropped
3. BRepMesh_FaceChecker::perform BndBox2dTreeSelector works in the parametric space, while the tolerance is provided in 3D space units
4. BRepMesh_GeomTool::IntSegSeg misses one case, when the result is Glued
5. BRepMesh_ModelHealer::amplifyEdges use a single instance of EdgeAmplifier
6. CSLib_Class2d even thought the implementation of NCollection_Handle::get is quite trivial, I saw it several times in the profiler taking some 5% of meshing time (maybe this was just due to debug mode and some address sanitizing - I am not sure)
7. GCPnts_TangentialDeflection::PerformCurve consider near points not only by parameter value, but also by 3D location

Please, let me know, if I should split the improvements into different commits/tickets.

Regards,
Dima
Steps To ReproduceN/A
TagsNo tags attached.
Test case number
Attached Files

- Relationships
related to 0032265closedbugmaster Modeling Algorithms - some trivial code improvements in CSLib_Class2d and GCPnts_TangentialDeflection 

-  Notes
(0099817)
git (administrator)
2021-03-29 14:55

Branch CR0032261 has been created by drazmyslovich.

SHA-1: dd519df32b999a83842cb293331069529d6bf959


Detailed log of new commits:

Author: Dzmitry Razmyslovich
Date: Mon Mar 29 13:54:42 2021 +0200

    0032261: Some trivial improvements for mesher
(0099819)
oan (developer)
2021-03-29 16:07

Hello Dima,

Yes, it would be nice if you split it to separate issues (branches):
- issues related to particular use case in BRepMesh, in Mesh category;
- CSLib_Class2d and GCPnts_TangentialDeflection should be registered in context of Modeling Algorithms.

This will help us to run tests for each particular issue, measure results and elaborate solutions if some of the patches would be the cause of unexpected regressions.

This issue might be used as the reference one to accumulate status of all subsequent tasks.

TIA,
Oleg.
(0099821)
oan (developer)
2021-03-29 16:39

By the way, could you please keep OCCT coding convention regarding names of variables, e.g. in CSLib_Class2d, BRepMesh_ModelHealer, etc.
(0099822)
kgv (developer)
2021-03-29 16:59

+    auto & pnts2dX = *MyPnts2dX;

Tip: usage of "auto" is discouraged in OCCT source code.
(0099838)
git (administrator)
2021-03-30 08:19

Branch CR0032261 has been updated forcibly by drazmyslovich.

SHA-1: 5bee4a8d3c1783622d3a799263f9dc88ddc6236e
(0099840)
drazmyslovich (developer)
2021-03-30 08:31

Hello, Oleg,

I separated the changes for CSLib_Class2d and GCPnts_TangentialDeflection into 0032265. And I checked all variable names used in the code I committed.

Please, let me know if I can somehow further improve the code.
Thank you.

Regards,
Dima
(0099969)
oan (developer)
2021-04-01 19:27

Is it possible to provide any use cases these fixes are intended for?
(0100121)
drazmyslovich (developer)
2021-04-06 11:24

Only for the 3rd point BRepMesh_FaceChecker::perform I can try and produce some use cases.
(0100127)
oan (developer)
2021-04-06 11:55

OK, it would be great anyway!
(0100270)
git (administrator)
2021-04-13 09:00

Branch CR0032261 has been updated forcibly by drazmyslovich.

SHA-1: 94d1b1f412ed2d1f9c61b30c7af04d34a6035e0b
(0100271)
git (administrator)
2021-04-13 09:01

Branch CR0032261 has been updated forcibly by drazmyslovich.

SHA-1: ac5da7d3654939ef797ad0e93bb9b6e61dffd86d
(0100272)
drazmyslovich (developer)
2021-04-13 09:05

Hello, Oleg,

unfortunately, after testing the change in BRepMesh_FaceChecker::perform within the whole our models database, I am not able to provide any reliable case, where this change has an influence.

Therefore, I dropped this change from the commit set. Moreover, I have separated all mentioned changes into several commits, so that you can easily check them isolated and drop some if necessary.

I am looking forward for your feedback.

Regards,
Dima
(0100273)
drazmyslovich (developer)
2021-04-13 09:06

So, the current branch contains the following changes:
1. BRepMesh_Delaun::isVertexInsidePolygon aTotalAng can be equal to -2 * M_PI, which still means 'inside'
2. BRepMesh_Delaun::decomposeSimplePolygon in case of anUsedLinkId == 3 the function always splits the polygon to one polygon with 2 links and the rest, which leads to additional memory allocations, while at the next iteration the first polygon is directly dropped
3. BRepMesh_GeomTool::IntSegSeg misses one case, when the result is Glued
4. BRepMesh_ModelHealer::amplifyEdges use a single instance of EdgeAmplifier
(0100278)
oan (developer)
2021-04-13 14:35

The entire set of the suggested changes leads to several regressions on OCCT's test database:

http://vm-jenkins-test-12.nnov.opencascade.com:8080/view/master-CR0032261-OAN/view/COMPARE/ [^]

I will try to apply changes one by one to identify the most stable combination.
(0100301)
git (administrator)
2021-04-14 20:28

Branch CR32261 has been created by oan.

SHA-1: 8447810a4210e0c3811eec75a8c5a480a66fe48b


Detailed log of new commits:

Author: Dzmitry Razmyslovich
Date: Wed Apr 14 20:28:29 2021 +0300

    0032261: Mesh - some trivial improvements for mesher
    
    BRepMesh_Delaun::isVertexInsidePolygon aTotalAng can be equal to -2 * M_PI, which still means 'inside'

Author: Dzmitry Razmyslovich
Date: Wed Apr 14 20:27:51 2021 +0300

    0032261: Mesh - some trivial improvements for mesher
    
    BRepMesh_ModelHealer::amplifyEdges use a single instance of EdgeAmplifier
(0100344)
git (administrator)
2021-04-16 16:00

Branch CR32261 has been updated forcibly by oan.

SHA-1: 5a6fee3fafce390a663d7cc5591235f567fa2400

- Issue History
Date Modified Username Field Change
2021-03-29 14:54 drazmyslovich New Issue
2021-03-29 14:54 drazmyslovich Assigned To => drazmyslovich
2021-03-29 14:55 git Note Added: 0099817
2021-03-29 14:58 drazmyslovich Assigned To drazmyslovich => oan
2021-03-29 14:58 drazmyslovich Status new => resolved
2021-03-29 14:58 drazmyslovich Steps to Reproduce Updated View Revisions
2021-03-29 16:07 oan Note Added: 0099819
2021-03-29 16:39 oan Note Added: 0099821
2021-03-29 16:59 kgv Note Added: 0099822
2021-03-29 16:59 kgv Summary Some trivial improvements for mesher => Mesh - some trivial improvements for mesher
2021-03-30 08:19 git Note Added: 0099838
2021-03-30 08:28 drazmyslovich Relationship added related to 0032265
2021-03-30 08:31 drazmyslovich Note Added: 0099840
2021-04-01 19:27 oan Note Added: 0099969
2021-04-06 11:24 drazmyslovich Note Added: 0100121
2021-04-06 11:24 drazmyslovich Assigned To oan => drazmyslovich
2021-04-06 11:24 drazmyslovich Status resolved => assigned
2021-04-06 11:55 oan Note Added: 0100127
2021-04-13 09:00 git Note Added: 0100270
2021-04-13 09:01 git Note Added: 0100271
2021-04-13 09:02 drazmyslovich Assigned To drazmyslovich => oan
2021-04-13 09:05 drazmyslovich Note Added: 0100272
2021-04-13 09:06 drazmyslovich Note Added: 0100273
2021-04-13 14:35 oan Note Added: 0100278
2021-04-14 20:28 git Note Added: 0100301
2021-04-16 16:00 git Note Added: 0100344


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker