View Issue Details

IDProjectCategoryView StatusLast Update
0023184CommunityOCCT:Meshpublic2013-04-29 15:24
Reporterdingzh Assigned Tooan  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2010 
Product Version6.5.3 
Target Version6.6.0Fixed in Version6.6.0 
Summary0023184: Bad face tessellation result
DescriptionLoad attached brep file, the face's tessellation is not good as expectation using tolerance 0.045 and API BRepMesh_IncrementalMesh.
I have tried it using Hypermesh and SolidWorks, and their results are good.

TagsNo tags attached.
Test case numberbugs mesh bug23184_1, bug23184_2

Attached Files

  • Tessellation.rar (147,904 bytes)
  • splittess.rar (50,172 bytes)
  • tricheck_results.png (13,382 bytes)

Relationships

related to 0023837 newoan Open CASCADE BRepMesh shouldn't trust the SameParameter flag 

Activities

dingzh

2012-05-31 07:01

reporter  

Tessellation.rar (147,904 bytes)

abv

2012-05-31 07:51

manager   ~0020607

The face is planar (built on a planar b-spline surface of degree 1) and has edges based on C0 curves, with knuckles. Triangulation algorithm does not respect these knuckles, producing tesselation that deflects from the actual curves by about 15 mm (my estimate). Note that this deflection is not reported by trinfo command.

We need to improve tesselation of edges to make it accurate and respecting the requested deflection.

dingzh

2012-05-31 08:43

reporter  

splittess.rar (50,172 bytes)

dingzh

2012-05-31 08:44

reporter   ~0020612

Hi abv,
 I just attached another simple case for tracing this bug. Thanks.
Ding

oan

2013-03-01 14:14

developer   ~0023550

Last edited: 2013-03-01 14:15

Dear pdn,
Please review the fix placed at CR23184_1 branch.

oan

2013-03-04 14:36

developer   ~0023574

Dear Bugmaster,
Please test.

mkv

2013-03-11 15:11

tester   ~0023641

Dear BugMaster,

Branch CR23184_1 (and products from GIT master) was compiled on Linux and Windows platforms.
SHA-1: 68913f9581fddb9ef9dc68ea73ce8520f39bfae7

Number of compiler warnings:

occt component :
Linux: 3 (3 on master)
Windows: 12(12 on master)

products component :
Linux: 10 (10 on master)
Windows: 50 (50 on master)

Regressions:
http://occt-tests/CR23184-1-master-occt/Windows-32-VC9/summary.html
http://occt-tests/CR23184-1-master-occt/Mandriva2010/summary.html
mesh standard_incmesh(002) W7 - Cross face errors
mesh standard_incmesh_parallel(007) W7 - Cross face errors
mesh standard_mesh(003) W7 - Cross face errors
mesh standard_shading(001) K9 - New value of area
mesh standard_shading(001) W7 - Cross face errors, Free nodes

Improvements:
No improvements

Testing cases:
bugs mesh bug23184_1, bug23184_2

Testing on Linux:
Total MEMORY difference: 238515988 / 238233340
Total CPU difference: 15020.15999999983 / 19048.010000000166

Testing on Windows:
Total MEMORY difference: 327889292 / 327627588
Total CPU difference: 12346.703125 / 15589.8125

There are not serious differences in images found by testdiff.

mkv

2013-03-11 15:14

tester   ~0023642

Dear oan,
could you please modify/validate testing cases bugs mesh bug23184_1, bug23184_2

oan

2013-03-11 17:00

developer   ~0023645

Last edited: 2013-03-11 17:02

Dear MKV,

Cross face errors are appearing due the rude deflection and partially invalid shape used in these test cases.


grid mesh standard_shading(001) K9:
Changing the edge sampling leads changes of the area and I suppose ~ 1.5% is not critical. Moreover, consequent fixes of the BRepMesh can turn this case back to the initial state.

Comparing the visual representations of the shape I establish the current representation is a little bit better than reference one.

Regarding to the test cases:
I suppose it will be more informative to display results in the top view:

tclean result
incmesh result 0.045
isos result 0
triangles result
top
fit

It's also useful to check areas using the triarea command to control possible changes in future.

Dear ABV,
could you aprove this fix for integration?

abv

2013-03-12 08:52

manager   ~0023653

Oleg, please try to find a way to keep this improvement without regressions (and cross-face errors are serious regressions in my opinion)

oan

2013-03-12 14:41

developer   ~0023666

Dear Andrey,

I've checked the information produced by tricheck and the command itself. So, in general: it performs iteration through the nodes of triangulations of two faces and compares the distances between the nodes with the same indices (that is actually incorrect, because it should perform checking "each to each" at least, as far as the distribution of nodes of a single face is independent of distribution of another one) with maximum deflection of comparing faces. I've used debug information and the following script to contrast incorrectness of behavior of tricheck command:

incmesh res 0.1
tricheck res
# crossed faces: {1, 2} & {1, 12}

explode res f

donly res_1 res_2 res_12
isos res_1 res_2 res_12 0
triangles res_1 res_2 res_12

small
fit


vertex v1_1 0.30181 -0.792642 0.228461
dtext 0.30181 -0.792642 0.228461 1_1

vertex v1_2 0.30181 -0.801999 0.306122
dtext 0.30181 -0.801999 0.306122 1_2

distmini d1 v1_1 v1_2
# 0.0782227


vertex v2_1 0.30181 -0.80559 0.3898
dtext 0.30181 -0.80559 0.3898 2_1

vertex v2_2 0.30181 -0.802804 0.470656
dtext 0.30181 -0.802804 0.470656 2_2

distmini d2 v2_1 v2_2
# 0.080904

trinfo res_1
# deflection: 0.017369606982662045

trinfo res_2
# deflection: 0.0095948882861707462

trinfo res_12
# deflection: 0.0011521390106117113


At the attached screenshot you can observe the pairs of vertices {1_1, 1_2} and {2_1, 2_2} lying on the shared edges. The function calculates distance between points of a pair (0.0782227 and 0.080904 correspondingly) and make decision that it doesn't fulfil the deflection (0.017369606982662045). So, this case is considered as a crossed faces error.

In conclusion, I propose to exclude this kind of errors from considering of regressions for the current state of tricheck functionality .

Fucnctionality of the cross faces check should be improved to provide more sensible results or should be eliminated at all.

oan

2013-03-12 14:42

developer  

tricheck_results.png (13,382 bytes)

abv

2013-03-14 08:48

manager   ~0023707

Mikhail, could you please comment on the above: it seems that 'cross-face' check in MeshTest_Check is not well defined. Do you recall what was its intent?

msv

2013-03-18 14:59

developer   ~0023777

The check of cross-face errors should not be eliminated. It is well defined (see MeshTest_CheckTopology.hxx):

//! - cross face errors. It is a situation when a point on a common
//! boundary between two faces has different 3d coordinates on each
//! triangulation. The error is reported if the distance is greater
//! than a deflection written in triangulations.

I would change this definition, in order to compare distance between nodes of triangulation with the real distance between curves representations (value returned by the DRAW command computetolerance), rather than with mesh deflection.

As applied to this problem, we checked with OAN and found out that the common edges in the shape have improper samerange/sameparameter flag, because the command computetolerance returns the value about 0.02, while the edge's tolerance is 2e-5. BRepMesh trusts the flag SameParameter, and when a new point is inserted in some polygon on triangulation, its insertion into another polygon with the same parameter gives wrong point.

So, the solution would be to stop trusting the SameParameter flag (recompute the flag locally).

oan

2013-03-19 16:03

developer   ~0023795

Last edited: 2013-03-20 10:26

Dear Bugmaster,

I suppose the target of this fix (improve tesselation of edges) has been achieved and therefore it can be integrated.

The problem described by MSV has different nature and will be solved separately. For this reason issue 0023837 "BRepMesh shouldn't trust the SameParameter flag" has been registered in Mantis.

Please provide corresponding TODOs for the test cases marked as regressions to indicate occurred problem.

mkv

2013-03-25 16:02

tester   ~0023884

Dear BugMaster,
Test cases
mesh/data/standard/K9,W7
mesh/end
was corrected, tested and pushed in git branches CR23184_1.

Branch CR23184_1 is TESTED.

Related Changesets

occt: master 32d878f5

2013-03-22 13:34:37

oan

Details Diff
0023184: Bad face tessellation result
Consider BSplineKnots to achieve better tessellation result
Adding test cases for this fix
Affected Issues
0023184
mod - src/BRepMesh/BRepMesh_FastDiscret.cxx Diff File
add - tests/bugs/mesh/bug23184_1 Diff File
add - tests/bugs/mesh/bug23184_2 Diff File

Issue History

Date Modified Username Field Change
2012-05-31 07:01 dingzh New Issue
2012-05-31 07:01 dingzh Assigned To => san
2012-05-31 07:01 dingzh File Added: Tessellation.rar
2012-05-31 07:51 abv Note Added: 0020607
2012-05-31 07:51 abv Assigned To san => oan
2012-05-31 07:51 abv Status new => assigned
2012-05-31 08:43 dingzh File Added: splittess.rar
2012-05-31 08:44 dingzh Note Added: 0020612
2012-11-09 09:54 abv Category OCCT:Visualization => OCCT:Mesh
2013-03-01 14:14 oan Note Added: 0023550
2013-03-01 14:15 oan Note Edited: 0023550
2013-03-01 14:15 oan Assigned To oan => pdn
2013-03-01 14:15 oan Status assigned => resolved
2013-03-01 15:38 abv Target Version => 6.6.0
2013-03-04 09:02 pdn Assigned To pdn => bugmaster
2013-03-04 09:02 pdn Status resolved => reviewed
2013-03-04 14:36 oan Note Added: 0023574
2013-03-04 18:43 mkv Assigned To bugmaster => mkv
2013-03-11 15:11 mkv Note Added: 0023641
2013-03-11 15:14 mkv Note Added: 0023642
2013-03-11 15:14 mkv Test case number => bugs mesh bug23184_1, bug23184_2
2013-03-11 15:14 mkv Assigned To mkv => oan
2013-03-11 15:14 mkv Status reviewed => assigned
2013-03-11 17:00 oan Note Added: 0023645
2013-03-11 17:00 oan Note Edited: 0023645
2013-03-11 17:01 oan Assigned To oan => abv
2013-03-11 17:01 oan Status assigned => feedback
2013-03-11 17:02 oan Note Edited: 0023645
2013-03-12 08:52 abv Note Added: 0023653
2013-03-12 08:52 abv Assigned To abv => omy
2013-03-12 08:52 abv Status feedback => assigned
2013-03-12 12:29 oan Assigned To omy => oan
2013-03-12 14:41 oan Note Added: 0023666
2013-03-12 14:42 oan File Added: tricheck_results.png
2013-03-12 14:42 oan Assigned To oan => abv
2013-03-12 14:43 oan Status assigned => feedback
2013-03-14 08:46 abv Assigned To abv => msv
2013-03-14 08:48 abv Note Added: 0023707
2013-03-18 14:59 msv Note Added: 0023777
2013-03-18 14:59 msv Assigned To msv => oan
2013-03-18 14:59 msv Status feedback => assigned
2013-03-19 15:49 oan Relationship added related to 0023837
2013-03-19 16:03 oan Note Added: 0023795
2013-03-19 16:05 oan Assigned To oan => bugmaster
2013-03-19 16:05 oan Status assigned => resolved
2013-03-19 16:10 oan Status resolved => reviewed
2013-03-19 18:17 mkv Assigned To bugmaster => mkv
2013-03-20 10:26 oan Note Edited: 0023795
2013-03-25 16:02 mkv Note Added: 0023884
2013-03-25 16:02 mkv Assigned To mkv => bugmaster
2013-03-25 16:02 mkv Status reviewed => tested
2013-03-25 18:39 oan Changeset attached => occt master 32d878f5
2013-03-25 18:39 oan Assigned To bugmaster => oan
2013-03-25 18:39 oan Status tested => verified
2013-03-25 18:39 oan Resolution open => fixed
2013-04-23 13:35 aiv Status verified => closed
2013-04-29 15:24 aiv Fixed in Version => 6.6.0