0406ba0e6ccec7b802826e6c58b848b711f3036d
[occt.git] / tests / mkface / end
1 #set MaxFTol 0
2 #set MaxETol 0
3 #set MaxVTol 0
4 if { [isdraw result] } {
5    #check if result is valid
6    puts [checkshape result]
7    set tolerance [tolerance result]
8    puts $tolerance
9    regexp { *FACE +: +MAX=([-0-9.+eE]+)} $tolerance full maxf 
10    regexp { *EDGE +: +MAX=([-0-9.+eE]+)} $tolerance full maxe 
11    regexp { *VERTEX +: +MAX=([-0-9.+eE]+)} $tolerance full maxv 
12
13    if { [info exists MaxFTol ] } {
14       if { $MaxFTol != 0 && $maxf > $MaxFTol && [expr abs($MaxFTol - $maxf)/$MaxFTol] > 0.01 } {
15          puts "Error : Result shape is WRONG. MAX tolerance of FACE should be equal $MaxFTol instead of $maxf"
16       } elseif { $MaxFTol == 0 && $maxf != 0 } {
17          puts "Error : Result shape is WRONG."
18       } else {
19          puts "MAX tolerance of FACE of result shape is equal $maxf"
20       }
21    } 
22
23    if { [info exists MaxETol ] } {
24       if { $MaxETol != 0 && $maxe > $MaxETol && [expr abs($MaxETol - $maxe)/$MaxETol] > 0.01 } {
25          puts "Error : Result shape is WRONG. MAX tolerance of EDGE should be equal $MaxETol instead of $maxe"
26       } elseif { $MaxETol == 0 && $maxe != 0 } {
27          puts "Error : Result shape is WRONG."
28       } else {
29          puts "MAX tolerance of EDGE of result shape is equal $maxe"
30       }
31    } 
32
33    if { [info exists MaxVTol ] } {
34       if { $MaxVTol != 0 && $maxv > $MaxVTol && [expr abs($MaxVTol - $maxv)/$MaxVTol] > 0.01 } {
35          puts "Error : Result shape is WRONG. MAX tolerance of VERTEX should be equal $MaxVTol instead of $maxv"
36       } elseif { $MaxVTol == 0 && $maxv != 0 } {
37          puts "Error : Result shape is WRONG."
38       } else {
39          puts "MAX tolerance of VERTEX of result shape is equal $maxv"
40       }
41    } 
42
43    smallview
44    clear
45    donly result
46    fit
47    xwd $imagedir/${test_image}.gif
48
49 } else {
50    puts "Error : The mkface can not be build."
51 }
52
53 # to end a test script
54 puts "TEST COMPLETED"