9f54bf6e713baea67cf4567f7ef56c7da7677571
[occt.git] / tests / bugs / mesh / bug25519
1 puts "================"
2 puts "CR25519"
3 puts "================"
4 puts ""
5 ###############################################
6 ## BRepMesh can break mesh regularity for BSpline surfaces
7 ###############################################
8
9 restore [locate_data_file bug25519_testtriangulation.brep] a
10
11 tclean a
12 incmesh a 0.01
13 front
14 fit
15 isos a 0
16 triangles a
17
18 set trinfo_s [trinfo a]
19 regexp {([0-9]+) triangles} ${trinfo_s} str nbtri_s
20 regexp {([0-9]+) nodes} ${trinfo_s} str nbnod_s
21 regexp {deflection ([0-9.+e-]+)} ${trinfo_s} str defl_s
22
23 set good_nbtri 2721
24 set good_nbnod 1405
25 set good_defl 0.048938765264496524
26
27 set good_percent 5
28
29 set nbtri_percent [expr abs (${good_nbtri} - ${nbtri_s}) / double (${nbtri_s}) * 100 ]
30 set nbnod_percent [expr abs (${good_nbnod} - ${nbnod_s}) / double (${nbnod_s}) * 100 ]
31 set defl_percent  [expr abs (${good_defl} - ${defl_s}) / ${defl_s} * 100 ]
32
33 if { ${nbtri_percent} > ${good_percent} } {
34   puts "Error: triangle number is bad, it has changed to ${nbtri_percent} %"
35 }
36
37 if { ${nbnod_percent} > ${good_percent} } {
38   puts "Error: node number is bad, it has changed to ${nbnod_percent} %"
39 }
40
41 if { ${defl_percent} > ${good_percent} } {
42   puts "Error: deflection is bad, it has changed to ${defl_percent} %"
43 }
44
45 set only_screen_axo 1