MantisBT - Community
View Issue Details
0031251Community[OCCT] OCCT:Meshpublic2019-12-17 21:182019-12-28 15:24
drazmyslovich 
bugmaster 
normalfeature 
verifiedfixed 
 
[OCCT] 7.5.0* 
0031251: Mesh - Add a parameter for IncrementalMesh to ignore face tolerance for face deflection
In our use case of the mesh representation of CAD model, it is highly important, that the desired linear deflection is kept as good as possible.
Unfortunately, often the files imported from 3rd party sources specify too high face tolerances which results in higher linear deflection for face.
Here I propose to add an additional flag to meshing parameters to enforce the linear deflection (or in other words to ignore face tolerance)
For example try to import attached step file and mesh using linear deflection 0.004 and angular deflection 0.244 The final deviation from CAD to mesh shows that 67% of mesh surface is over 0.004 distance from CAD surface...

This is maybe kind of acceptable for text based formats like STEP, but enforcing the mesh deflection improves reasonably the final result.
No tags attached.
related to 0025287verified bugmaster BRepMesh_IncrementalMesh produces (way) out of tolerance mesh 
? Albatros d2 elisa a.STEP (1,092,666) 2019-12-17 21:36
https://tracker.dev.opencascade.org/
Issue History
2019-12-17 21:18drazmyslovichNew Issue
2019-12-17 21:18drazmyslovichAssigned To => drazmyslovich
2019-12-17 21:20gitNote Added: 0089612
2019-12-17 21:27kgvSummaryAdd a parameter for IncrementalMesh to ignore face tolerance for face deflection => Mesh - Add a parameter for IncrementalMesh to ignore face tolerance for face deflection
2019-12-17 21:36drazmyslovichAssigned Todrazmyslovich => oan
2019-12-17 21:36drazmyslovichStatusnew => resolved
2019-12-17 21:36drazmyslovichSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=22376#r22376
2019-12-17 21:36drazmyslovichFile Added: Albatros d2 elisa a.STEP
2019-12-20 19:33gitNote Added: 0089685
2019-12-20 20:07oanRelationship addedrelated to 0025287
2019-12-23 11:01oanNote Added: 0089701
2019-12-23 11:06oanNote Added: 0089702
2019-12-23 11:06oanAssigned Tooan => msv
2019-12-23 11:06oanStatusresolved => feedback
2019-12-23 15:15msvNote Added: 0089713
2019-12-23 15:16msvAssigned Tomsv => oan
2019-12-23 15:16msvStatusfeedback => assigned
2019-12-23 15:19msvNote Added: 0089714
2019-12-23 15:50oanNote Added: 0089715
2019-12-23 15:51msvNote Added: 0089716
2019-12-23 16:02oanNote Edited: 0089715bug_revision_view_page.php?bugnote_id=89715#r22401
2019-12-23 16:03oanNote Edited: 0089715bug_revision_view_page.php?bugnote_id=89715#r22402
2019-12-23 16:05gitNote Added: 0089717
2019-12-23 17:03oanNote Added: 0089721
2019-12-23 17:03oanNote Edited: 0089721bug_revision_view_page.php?bugnote_id=89721#r22404
2019-12-23 18:00gitNote Added: 0089722
2019-12-24 11:27gitNote Added: 0089724
2019-12-24 11:28oanNote Added: 0089725
2019-12-24 11:28oanAssigned Tooan => msv
2019-12-24 11:28oanStatusassigned => resolved
2019-12-24 11:56msvNote Added: 0089727
2019-12-24 11:56msvAssigned Tomsv => oan
2019-12-24 11:56msvStatusresolved => assigned
2019-12-24 12:22oanNote Added: 0089730
2019-12-24 12:22oanAssigned Tooan => msv
2019-12-24 12:22oanStatusassigned => feedback
2019-12-24 12:42msvAssigned Tomsv => oan
2019-12-24 12:42msvStatusfeedback => assigned
2019-12-24 14:11gitNote Added: 0089736
2019-12-24 16:16oanAssigned Tooan => msv
2019-12-24 16:16oanStatusassigned => resolved
2019-12-25 10:02msvNote Added: 0089746
2019-12-25 10:02msvAssigned Tomsv => bugmaster
2019-12-25 10:02msvStatusresolved => reviewed
2019-12-28 13:37bugmasterChangeset attached => occt master 0da2ecac
2019-12-28 13:37bugmasterStatusreviewed => verified
2019-12-28 13:37bugmasterResolutionopen => fixed
2019-12-28 15:24gitNote Added: 0089802

Notes
(0089612)
git   
2019-12-17 21:20   
Branch CR31251 has been created by drazmyslovich.

SHA-1: 80048edde5912d20a36efa69cf63be3933b91d79


Detailed log of new commits:

Author: razmyslovich
Date: Tue Dec 17 19:17:17 2019 +0100

    0031251: Add a new meshing parameter to enforce face linear deflection
(0089685)
git   
2019-12-20 19:33   
Branch CR31251 has been updated by oan.

SHA-1: 1a7a2b8a5b7398e9a5ee81bf4e361c2be6160ec4


Detailed log of new commits:

Author: oan
Date: Thu Dec 19 13:14:23 2019 +0300

    #Parameter has been renamed to TightFit. Added test case.
    
    New parameter -tight has been added to incmesh command.

(0089701)
oan   
2019-12-23 11:01   
Hello Dima!

Thank you a lot for your patch.
As for non-regression tests, they're OK, given that I have renamed parameter to TightFit. Maybe, it is as ambiguous as ForceDeflection due to dual nature of face and edge deflection parameters, but IMHO it would explain results of adjustment of face deflection better.

Best regards,
Oleg.
(0089702)
oan   
2019-12-23 11:06   
Dear Mikhail,

test results are available by the following link:
http://jenkins-test-12.nnov.opencascade.com/view/CR31251-master-OAN/view/COMPARE/ [^]

Please review.

By the way, what if we make new behaviour default without any additional parameter since its logic seems correct for general case?
(0089713)
msv   
2019-12-23 15:15   
For me, ForceDeflection name is more understandable and its implementation follows its name (even with your implementation version).

Bug in your version is that you pass face tolerance (absolute value) to the function ComputeAbsoluteDeflection() that treats it as relative (in the case of theParameters.Relative is true).

As for the new test, I see the following lines:

incmesh result 0.004 -a 14 -tight
checktrinfo result -tri 290474 -nod 149903 -defl 0.041867171925924547

It means that we request deflection 0.004, but obtain on output 0.04, that is ten times worse than requested. Is it unavoidable, or can we do something more to achieve the requested value?
(0089714)
msv   
2019-12-23 15:19   
We cannot do this the default behavior. For an shape with honest tolerances, if some defect in the shape was neglected using a big tolerance, the algorithm may fail discretizing such shape if it ignores the tolerance of the shape.
(0089715)
oan   
2019-12-23 15:50   
(edited on: 2019-12-23 16:03)
As for face tolerance that has been taken into account, I thought that usage of deflections smaller than face tolerance (given that face is valid) is illogical as far as 3D point could be within specified tolerance from real surface.

(0089716)
msv   
2019-12-23 15:51   
Agreed to use the term ForceFaceDeflection.
If it is true then exclude face tolerance as well as tolerances of its edges/vertices from consideration when assigning the requested deflection for the inner part of the face.
Face tolerance as it is has no any geometrical sense for the purpose of meshing.
(0089717)
git   
2019-12-23 16:05   
Branch CR31251 has been updated forcibly by oan.

SHA-1: 7f67c023fc0880b6c328029eb938e39dc520b3b9
(0089721)
oan   
2019-12-23 17:03   
>> It means that we request deflection 0.004, but obtain on output 0.04, that is ten times worse than requested. Is it unavoidable, or can we do something more to achieve the requested value?

Currently, yes, it is unavoidable. Such a huge tolerance is caused by points on edges and segments built upon them. Here, mesh optimization ends up after 11 iterations with value 0.04579460790575135 on some face and stores it as the final result.

As a possible solution, user-defined deflection passed as a parameter to the algorithm could be used as is, without reference to edge tolerance, given that it is also has no geometrical sence in context of meshing.

(0089722)
git   
2019-12-23 18:00   
Branch CR31251 has been updated forcibly by oan.

SHA-1: 144950507c787fb2ecb48fda16eab86e30fb2418
(0089724)
git   
2019-12-24 11:27   
Branch CR31251 has been updated forcibly by oan.

SHA-1: 187a444f3332d905d95b93ed4ef4150c571ba16c
(0089725)
oan   
2019-12-24 11:28   
Test results are available by the following link:
http://jenkins-test-12.nnov.opencascade.com/view/CR31251-master-OAN/view/COMPARE/ [^]

Latest commit contains corrected test case mentioned in the results.
(0089727)
msv   
2019-12-24 11:56   
tests/bugs/mesh/bug31251 is failed in the result.
(0089730)
oan   
2019-12-24 12:22   
Please see comment given in previous note.

This fail is due to rebase.
(0089736)
git   
2019-12-24 14:11   
Branch CR31251 has been updated forcibly by oan.

SHA-1: 27a8ce133db8c99257f48f86a7730467bd1f11f9
(0089746)
msv   
2019-12-25 10:02   
Reviewed.
(0089802)
git   
2019-12-28 15:24   
Branch CR31251 has been deleted by inv.

SHA-1: 27a8ce133db8c99257f48f86a7730467bd1f11f9