0026855: Draw commands to debug Boolean Operations Algorithm
[occt.git] / tests / bugs / end
CommitLineData
355c1551 1if { [info exists square] } {
2 set prop "square"
3 set mass $square
4 if { [info exists tol_square] } {
b1c5c4e6 5 # tol_square - The epsilon defines relative precision of computation
302f96fb 6 regexp {Mass +: +([-0-9.+eE]+)} [sprops result $tol_square] full m
355c1551 7 } else {
302f96fb 8 regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m
355c1551 9 }
10}
11if { [info exists length] } {
12 set prop "length"
13 set mass $length
14 regexp {Mass +: +([-0-9.+eE]+)} [lprops result] full m
15
16 puts "checksection"
17 puts [checksection result]
18}
19
20#if mass (length or square) is empty in test case then result should be an empty shape.
21if { [info exists mass] } {
22 if { [string compare $subgroup "moddata"] != 0 } {
302f96fb 23 puts "checkshape"
24 checkshape result
355c1551 25 }
26
27 if { [string compare "$mass" "empty"] != 0 } {
302f96fb 28 if { $m == 0 } {
29 puts "Error : The command is not valid. The $prop is 0."
30 }
31 if { $mass > 0 } {
32 puts "The expected $prop is $mass"
33 }
34 #check of change of square is < 1%
35 if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
36 puts "Error : The $prop of result shape is $m"
37 }
355c1551 38 } else {
302f96fb 39 if { $m != 0 } {
40 puts "Error : The command is not valid. The $prop is $m"
41 }
355c1551 42 }
43}
44
456b33eb 45if { [info exists rel_tol] } {
46 puts "\nChecking triangulation area (triarea command)..."
47 set rel_err [expr abs([CheckTriArea result $area_eps])]
48 if { $rel_err > $rel_tol } {
49 puts "Error : area by triangles differs from the actual area by $rel_err %"
50 } else {
51 if { $rel_tol > 1 && $rel_tol < 100 } {
302f96fb 52 puts "Error: Improvement: The current area difference is $rel_err instead of $rel_tol"
456b33eb 53 }
54 }
55}
56
fa920fb1 57if { [isdraw result] } {
18d715bd 58 if { [info exists 2dviewer] } {
302f96fb 59 clear
60 smallview
61 donly result
62 fit
63 xwd $imagedir/${test_image}.png
18d715bd 64 }
65 if { [info exists 3dviewer] } {
66 #for multiview support: dump result from all opened views
67 set view_str [vviewlist long]
5064550f 68 if { [llength ${view_str}] == 0 } {
69 vinit
70 set view_str [vviewlist long]
71 }
18d715bd 72 set view_list [regexp -all -inline {\S+} $view_str]
73 foreach {view_name} $view_list {
74 vactivate $view_name
75 vclear
76 vdisplay result
77 vsetdispmode 1
78 vfit
79 vzfit
80 vdump $imagedir/${test_image}_[regsub -all {/} $view_name {_}].png
81 }
82 }
83}
84
85if { [info exists only_screen] } {
86 #for multiview support: dump result from all opened views
87 set view_str [vviewlist long]
88 set view_list [regexp -all -inline {\S+} $view_str]
89 foreach {view_name} $view_list {
90 vactivate $view_name
91 vdump $imagedir/${test_image}_[regsub -all {/} $view_name {_}].png
92 }
93}
94
95if { [info exists only_screen_axo] } {
f34eec8f 96 xwd $imagedir/${test_image}.png
97}
98
fa920fb1 99# to end a test script
100puts "TEST COMPLETED"