0024923: BRepMesh_CircleTool produces bad circles
[occt.git] / tests / bugs / mesh / bug22778
CommitLineData
44cf55e6 1# test for #22778: compare number of triangles in triangulation
2# produced on surface converted to nurbs, against number of triangles on
3# original analytic (spherical) surface
4
5puts "TODO #22778 All: too many triangles"
6
7# original face on spherical surface
8restore [locate_data_file bug22778_square.brep] s
9checkshape s
10incmesh s 0.001
11set trinfo_s [trinfo s]
12regexp {([0-9]+) triangles} $trinfo_s str nbtri_s
13regexp {deflection ([0-9.+e-]+)} $trinfo_s str defl_s
14
15# face converted to NURBS
16nurbsconvert r s
17checkshape r
18incmesh r 0.001
19set trinfo_r [trinfo r]
20regexp {([0-9]+) triangles} $trinfo_r str nbtri_r
21regexp {deflection ([0-9.+e-]+)} $trinfo_r str defl_r
22
23# check deflections
24if { $defl_s > 0.001 } {
25 puts "Error: too big deflection on original face ($defl_s > 0.001)"
26}
27if { $defl_r > 0.001 } {
28 puts "Error: too big deflection on NURBS face ($defl_r > 0.001)"
29}
30
31# compare number of triangles, allow twice more
32if { $nbtri_r > [expr 2. * $nbtri_s] } {
33 puts "Error: too many triangles ($nbtri_r, while ~ $nbtri_s would be sufficient)"
34}
35
36# extra check: deflection on rough mesh on NURBS
37tclean r
38incmesh r 0.1
39set trinfo_r_01 [trinfo r]
40regexp {deflection ([0-9.+e-]+)} $trinfo_r_01 str defl_r_01
41if { $defl_r_01 > 0.1 } {
42 puts "Error: too big deflection on NURBS face ($defl_r > 0.1)"
43}