View Issue Details

IDProjectCategoryView StatusLast Update
0022818CommunityOCCT:Meshpublic2014-09-01 17:48
Reporterszy Assigned Tooan  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.5.2 
Target Version6.6.0Fixed in Version6.6.0 
Summary0022818: Wrong triangulation of Revolution surface with slice angle <= 180 degree
DescriptionPost from the Forum - http://www.opencascade.org/org/forum/thread_22257/.
"hi there,

triangulation of BRepPrimAPI_MakeRevol fails under some circumstances.
reproduceable in 6.3 and 6.5 versions
bug reproduction in pseudocode:

(1) revol a Face: point of gp_ax1 has SAME coordinates as a point in the profile for revolution

     p1 gp_Pnt(0,10,0)
     p2 gp_Pnt(0,10,10)
     p3 gp_Pnt(0,0,-10)
     dir1 gp_Dir(0,0,1)
     
     ax1 gp_Ax1(p1,dir1)
     
     v1 BRepPrimAPI_MakeVertex(p1)
     v2 BRepPrimAPI_MakeVertex(p2)
     v3 BRepPrimAPI_MakeVertex(p3)
     
     e1 BRepPrimAPI_MakeEdge(v1,v2)
     e2 BRepPrimAPI_MakeEdge(v2,v3)
     e3 BRepPrimAPI_MakeEdge(v3,v1)
     
     w1 BRepPrimAPI_MakeWire(e1,e2,e3)
     
     f1 BRepPrimAPI_MakeFace(w1)
     
     rev1 BRepPrimAPI_Makerevol(f1,ax1,180°) #i know its in rads but for readability
     
     => front and back faces are not created, face of revolution looks weird

     
(2) revol a Face: point of gp_ax1 has OTHER coordinates as a point in the profile for revolution

     p1 gp_Pnt(0,10,0)
     p2 gp_Pnt(0,10,10)
     p3 gp_Pnt(0,5,5)
     
     p4 gp_Pnt(0,0,-10)
     dir1 gp_Dir(0,0,1)
     
     ax1 gp_Ax1(p4,dir1)
     
     v1 BRepPrimAPI_MakeVertex(p1)
     v2 BRepPrimAPI_MakeVertex(p2)
     v3 BRepPrimAPI_MakeVertex(p3)
     
     e1 BRepPrimAPI_MakeEdge(v1,v2)
     e2 BRepPrimAPI_MakeEdge(v2,v3)
     e3 BRepPrimAPI_MakeEdge(v3,v1)
     
     w1 BRepPrimAPI_MakeWire(e1,e2,e3)
     
     f1 BRepPrimAPI_MakeFace(w1)
     
     rev1 BRepPrimAPI_Makerevol(f1,ax1,180°) #i know its in rads but for readability
     
     => front and back faces are not created

     
(3) revol a Geom_Interpolate: point of gp_ax1 has same coordinates as a point in the profile for revolution

     p1 gp_Pnt(0,0,0)
     p2 gp_Pnt(5,7,0)
     p3 gp_Pnt(10,10,0)
     dir1 gp_Dir(0,1,0)
     
     ax1 gp_Ax1(p1,dir1)
     
     harray TColgp_HArray1OfPnt(1,3)
     harray->setValue(1,p1)
     harray->setValue(2,p2)
     harray->setValue(3,p3)
     
     spline GeomAPI_Interpolate(harray ,false,10E-7)
     spline->perform
     Geom_BSplineCurve s = repSpline.Curve();
     
     e1 BRepPrimAPI_MakeEdge(s)
     
     rev1 BRepPrimAPI_Makerevol(e1,ax1,180°) #i know its in rads but for readability
     
     => no face at all, only edge created"
=========================
Pictures presenting wrong triangulation are attached
Steps To Reproducepload MODELING AISV
vertex v1 0 10 0
vertex v2 0 10 10
vertex v3 0 0 -10
edge e1 v1 v2
edge e2 v2 v3
edge e3 v3 v1
wire w1 e1 e2 e3
plane pln 0 10 0 1 0 0
mkface f1 pln
add w1 f1
don f1
revol r f1 0 10 0 0 0 1 180
fit
checkshape r
vinit
vsetdispmode 1
vdisplay r
vfit
==============
pload MODELING AISV
vertex v1 0 10 0
vertex v2 0 10 10
vertex v3 0 5 5
vertex v4 0 0 -10
edge e1 v1 v2
edge e2 v2 v3
edge e3 v3 v1
wire w1 e1 e2 e3
plane pln 0 5 5 1 0 0
mkface f1 pln
add w1 f1
don f1
revol r f1 0 10 0 0 0 1 180
fit
checkshape r
vinit
vsetdispmode 1
vdisplay r
vfit

Additional information
and documentation updates
To Release Notes:
The algorithm of standard OCCT triangulation has been fixed to correctly build triangulation of a face of conical-like sector less than 180 degrees with degeneracy.
TagsNo tags attached.
Test case numberbugs modalg_2(007) bug22818_1,bug22818_2,bug22818_3,bug22818_4

Attached Files

  • 22257.zip (70,434 bytes)
  • cone.PNG (24,449 bytes)

Relationships

parent of 0023832 closedika Open CASCADE sprops and triarea commands return incorrect value of a mass for shape of revolution 
has duplicate 0023282 closedmkv Community Wrong triangulation on cone 
related to 0025157 closedbugmaster Community Face missing depending the angle of revolution 

Activities

szy

2011-11-29 12:33

manager  

22257.zip (70,434 bytes)

msv

2011-12-01 16:31

developer   ~0018698

The same error is for cone shape:

pcone c 10 0 10 180
vdisplay c

msv

2011-12-01 16:36

developer  

cone.PNG (24,449 bytes)

msv

2011-12-01 17:45

developer   ~0018700

Last edited: 2011-12-01 17:46

I have attached the picture with triangulation of the conic face.
I have found that regression occurred in the version 3.1 comparing to 3.0 of OCCT.
The binaries for WNT are located in \\slotex\sbu\OS\FIXOCC30 and FIXOCC31.
The simple script that works and reproduces the problem in that version is:

pcone c 10 0 20 180
incmesh c 0.1
triangles c
isos c 0
view 1 +X+Y
fit

msv

2011-12-05 16:36

developer   ~0018745

Fixed in branch http://svn/svn/occt/branches/0022818.
Pavel, please, review it.

pdn

2011-12-05 16:45

reporter   ~0018746

The fixes are OK. No comments...

mkv

2011-12-07 19:19

tester   ~0018774

Dear BugMaster,
Workbench KAS:dev:mkv-22818-occt was created from SVN branch http://svn/svn/occt/branches/0022818
(and mkv-22818-products from trunk) and compiled on Linux platform.

There are following regressions in mkv-22818-products regarding to KAS:dev:products-652-opt.
chl 902 F1
chl 918 L7
chl 927 L3

chl 905 A4
chl 913 K4
chl 918 K2
chl 919 A3
chl 922 R9

chl 929 D1 D2 D5 D6 D8
chl 934 B1
chl 913 D1

msh 004 A2
msh 001 A3 C8 E8 M5 Q9 T4
msh 002 A3 C8
msh 003 A2
msh 002 E8 M5 Q9 T4

msh 001 K7 - Improvement
msh 002 K7 - Improvement

shd 001 A3 E9 R4
shd 002 A1 A2 B6 C6
shd 003 A1 A2 A3 A4 A5

shd 001 L1 - Improvement
shd 002 A4 - Improvement

See results in /QADisk/occttests/results/KAS/dev/mkv-22818-products_07122011/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-652-opt_23092011/lin
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification

abv

2012-11-06 11:02

manager   ~0022095

The fix is rebased on current master (branch CR22818_1), problems are still there

pdn

2013-03-04 12:19

reporter   ~0023573

Dear Oleg,
Please consult to msv about fix finalization

oan

2013-03-12 10:48

developer   ~0023657

Dear EPA,
Could you please review the fix at CR22818 Git branch.

epa

2013-03-12 10:52

developer   ~0023658

Dear bugmaster,
please test

mkv

2013-03-14 19:03

tester   ~0023731

Dear BugMaster,

Branch CR22818 (and products from GIT master) was compiled on Linux and Windows platforms and tested without rebase.
SHA-1: f654183e4e96122cdfbd47b039d3c91e349eb5a9

Number of compiler warnings:

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

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

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
bugs modalg_2(007) bug22818_1,bug22818_2,bug22818_3,bug22818_4 - OK.

Testing on Linux:
Total MEMORY difference: 242985360 / 243420652
Total CPU difference: 16270.469999999765 / 15475.990000000036

Testing on Windows:
Total MEMORY difference: 342593728 / 342850096
Total CPU difference: 17938.71875 / 20377.4375

There following differences in images found by testdiff.
http://occt-tests/CR22818-master-occt/Mandriva2010/diff-Mandriva2010.html
http://occt-tests/CR22818-master-occt/Windows-32-VC9/diff-Windows-32-VC9.html

IMAGE bugs modalg_2 bug22818_1: bug22818_1.png differs - Improvement
IMAGE bugs modalg_2 bug22818_2: bug22818_2.png differs - Improvement
IMAGE bugs moddata_1 bug22757: bug22757.png differs
IMAGE mesh standard_shading L1: L1.png differs - Improvement
IMAGE mesh standard_incmesh_parallel J8: J8.png differs - Improvement
IMAGE mesh standard_incmesh_parallel L1: L1.png differs - Improvement
IMAGE mesh advanced_shading C2: C2.png differs - Improvement
IMAGE mesh standard_mesh J8: J8.png differs - Improvement
IMAGE mesh standard_mesh L1: L1.png differs - Improvement
IMAGE mesh standard_incmesh J8: J8.png differs - Improvement
IMAGE mesh standard_incmesh L1: L1.png differs - Improvement

IMAGE bugs vis buc60887: buc60887.png differs - only on Windows

mkv

2013-03-14 19:06

tester   ~0023732

Dear oan,
could you please review test cases for this fix:
bugs modalg_2(007) bug22818_1,bug22818_2,bug22818_3,bug22818_4.

oan

2013-03-14 19:45

developer   ~0023734

Dear Mikhail,

It would be better if you took a well-known approach of detection the difference between the geometrical square and square defined by triangulation widely used in our test cases instead using the constant values. In my opinion, this way is the most correct from the point of view of automatic testing.

Please find the "end" file in the "/tests/mesh/" directory. It already contains functionality described above:

# Check if area of triangles is valid
proc CheckTriArea {shape {eps 0}} {
  upvar #0 $shape a
  set area [triarea a $eps]
  set t_area [lindex $area 0]
  set g_area [expr abs([lindex $area 1])]
  puts "area by triangles: $t_area"
  puts "area by geometry: $g_area"
  expr ($t_area - $g_area) / $g_area * 100
}

puts "\nChecking triangulation area (triarea command)..."
set rel_err [expr abs([CheckTriArea res $area_eps])]
if { $rel_err > $rel_tol } {
    puts "Error : area by triangles differs from the actual area by $rel_err %"
} else {
    if { $rel_tol > 1 && $rel_tol < 100 } {
    puts "Error: Improvement: The current area difference is $rel_err instead of $rel_tol"
    }
}


Please have a look there and try to accommodate it for the test cases for this bug.

abv

2013-03-15 10:58

manager   ~0023736

IMAGE offset shape_type_i D7: D7.png differs -- looks like regression?

oan

2013-03-15 11:15

developer   ~0023738

Dear Andrey,

I suppose there is no dependence between the test case offset faces_type_i D7 and actual changes in the BRepMesh.

Please find the corresponding test case in "test" directory of OCC or through the Jenkins interface.

mkv

2013-03-15 17:25

tester   ~0023756

Dear oan,
Afther this modifications in test cases now there are following regressions on Linux and Windows platforms:

bugs modalg_2(007) bug22818_1 bug22818_2

oan

2013-03-15 17:55

developer   ~0023757

Dear Mikhail,

Thank you. It's quite interesting, because the shapes seems Ok in viewer. I suppose that tricheck and sprops commands return incorrect data for shapes of revolution.

oan

2013-03-15 18:16

developer   ~0023758

Dear Bugmaster,

bug 0023832 "sprops and triarea commands return incorrect value of a mass for shape of revolution" has been registered in Mantis.

please integrate the fix for 0022818.

mkv

2013-03-22 20:56

tester   ~0023877

Dear BugMaster,
Test cases
bugs modalg_2(007) bug22818_1 and bug22818_2
was corrected, tested and pushed in git branches CR23832 and CR22818.

Branch CR22818 is TESTED.

Related Changesets

occt: master b62b93ac

2013-03-22 13:44:31

oan

Details Diff
0022818: Wrong triangulation of Revolution surface with slice angle <= 180 degree
Take face attributes into account to calculate 2d tolerance
Adding test cases for this fix
Correction according additional bug CR23832
Affected Issues
0022818
mod - src/BRepMesh/BRepMesh_FastDiscret.cxx Diff File
mod - src/BRepMesh/BRepMesh_FastDiscretFace.cdl Diff File
mod - src/BRepMesh/BRepMesh_FastDiscretFace.cxx Diff File
mod - tests/bugs/modalg_2/bug22818_1 Diff File
mod - tests/bugs/modalg_2/bug22818_2 Diff File
add - tests/bugs/modalg_2/bug22818_3 Diff File
add - tests/bugs/modalg_2/bug22818_4 Diff File

Issue History

Date Modified Username Field Change
2011-11-29 12:33 szy New Issue
2011-11-29 12:33 szy Assigned To => jgv
2011-11-29 12:33 szy File Added: 22257.zip
2011-11-29 12:33 szy Assigned To jgv => msv
2011-11-29 12:33 szy Status new => assigned
2011-12-01 16:31 msv Note Added: 0018698
2011-12-01 16:36 msv File Added: cone.PNG
2011-12-01 17:45 msv Note Added: 0018700
2011-12-01 17:46 msv Note Edited: 0018700
2011-12-05 16:36 msv Note Added: 0018745
2011-12-05 16:36 msv Assigned To msv => pdn
2011-12-05 16:36 msv Status assigned => resolved
2011-12-05 16:45 pdn Note Added: 0018746
2011-12-05 16:46 pdn Assigned To pdn => msv
2011-12-05 16:46 pdn Status resolved => reviewed
2011-12-05 17:17 msv Additional Information Updated
2011-12-05 17:18 msv Assigned To msv => bugmaster
2011-12-07 19:19 mkv Note Added: 0018774
2011-12-07 19:20 mkv Assigned To bugmaster => msv
2011-12-07 19:20 mkv Status reviewed => assigned
2011-12-09 16:55 apn Test case number => chl 934 N1 N2
2012-03-22 06:23 abv Target Version 6.5.3 => 6.5.4
2012-10-23 18:41 abv Target Version 6.5.4 => 6.6.0
2012-11-06 11:02 abv Note Added: 0022095
2012-11-09 10:45 abv Category OCCT:Modeling Algorithms => OCCT:Mesh
2012-11-09 10:46 abv Relationship added has duplicate 0023282
2013-03-04 12:17 abv Assigned To msv => oan
2013-03-04 12:19 pdn Note Added: 0023573
2013-03-12 10:48 oan Note Added: 0023657
2013-03-12 10:48 oan Assigned To oan => epa
2013-03-12 10:51 oan Status assigned => resolved
2013-03-12 10:52 epa Note Added: 0023658
2013-03-12 10:52 epa Assigned To epa => bugmaster
2013-03-12 10:52 epa Status resolved => reviewed
2013-03-12 11:36 mkv Assigned To bugmaster => mkv
2013-03-14 19:03 mkv Note Added: 0023731
2013-03-14 19:06 mkv Note Added: 0023732
2013-03-14 19:07 mkv Test case number chl 934 N1 N2 => bugs modalg_2(007) bug22818_1,bug22818_2,bug22818_3,bug22818_4
2013-03-14 19:07 mkv Assigned To mkv => oan
2013-03-14 19:07 mkv Status reviewed => assigned
2013-03-14 19:45 oan Note Added: 0023734
2013-03-14 19:46 oan Assigned To oan => mkv
2013-03-15 10:58 abv Note Added: 0023736
2013-03-15 11:15 oan Note Added: 0023738
2013-03-15 17:25 mkv Note Added: 0023756
2013-03-15 17:26 mkv Assigned To mkv => oan
2013-03-15 17:55 oan Note Added: 0023757
2013-03-15 18:16 oan Note Added: 0023758
2013-03-15 18:20 oan Assigned To oan => bugmaster
2013-03-18 11:13 mkv Relationship added parent of 0023832
2013-03-19 14:38 mkv Status assigned => resolved
2013-03-19 14:38 mkv Assigned To bugmaster => mkv
2013-03-19 14:38 mkv Status resolved => reviewed
2013-03-22 20:56 mkv Note Added: 0023877
2013-03-22 20:56 mkv Assigned To mkv => bugmaster
2013-03-22 20:56 mkv Status reviewed => tested
2013-03-25 18:39 oan Changeset attached => occt master b62b93ac
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
2014-09-01 17:48 oan Relationship added related to 0025157