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
5 puts "TODO #22778 All: too many triangles"
7 # original face on spherical surface
8 restore [locate_data_file bug22778_square.brep] s
11 set trinfo_s [trinfo s]
12 regexp {([0-9]+) triangles} $trinfo_s str nbtri_s
13 regexp {deflection ([0-9.+e-]+)} $trinfo_s str defl_s
15 # face converted to NURBS
19 set trinfo_r [trinfo r]
20 regexp {([0-9]+) triangles} $trinfo_r str nbtri_r
21 regexp {deflection ([0-9.+e-]+)} $trinfo_r str defl_r
24 if { $defl_s > 0.001 } {
25 puts "Error: too big deflection on original face ($defl_s > 0.001)"
27 if { $defl_r > 0.001 } {
28 puts "Error: too big deflection on NURBS face ($defl_r > 0.001)"
31 # compare number of triangles, allow twice more
32 if { $nbtri_r > [expr 2. * $nbtri_s] } {
33 puts "Error: too many triangles ($nbtri_r, while ~ $nbtri_s would be sufficient)"
36 # extra check: deflection on rough mesh on NURBS
39 checktrinfo r -max_defl 0.1