0026002: Visualization, TKOpenGl - detect alien Core Profile context
[occt.git] / tests / sewing / end
1 set cs_a [checkshape a]
2 puts "checkshape a"
3 if { [info exists nb_f] == 0 } {
4   set nb_f 0
5 }
6 if { $cs_a == "This shape seems to be valid"} {
7   puts "Shape a seems to be valid"
8   set nb_a 0
9 } else {
10   puts "Shape a is not valid"
11   regexp {Faulty shapes in variables faulty_([0-9]*) to faulty_([0-9]*)} $cs_a full nb_a_begin nb_a_end
12   puts "Number of faulties is [expr $nb_a_end - $nb_a_begin +1]"
13   set nb_a [expr $nb_a_end - $nb_a_begin +1]
14 }
15
16 set exp [explode a f]
17 set L [concat compound $exp C]
18 eval $L
19 puts [whatis C]
20 puts [sewing result $tol C]
21
22 if { [isdraw result] } {
23   set cs_r [checkshape result]
24   puts "checkshape result"
25   if { $cs_r == "This shape seems to be valid"} {
26     puts "Shape result seems to be valid"
27     set nb_r 0
28   } else {
29     puts "Shape result is not valid"
30     regexp {Faulty shapes in variables faulty_([0-9]*) to faulty_([0-9]*)} $cs_r full nb_r_begin nb_r_end
31     set nb_r [expr $nb_r_end - $nb_r_begin +1]
32   }
33   set t [dtyp result]
34   puts $t
35   set w [lindex $t 1]
36   if {"$w" == "SHELL"} {
37     freebounds $result -0.01
38     set s [explode result_c e]
39     puts $s
40     set index [ llength $s ]
41     #nbFreeEdges is set to empty only in cases of unstable work of sewing (see #24591).
42     if { [string compare "$nbFreeEdges" ""] == 0 || $index != $nbFreeEdges } {
43       puts "Error : Number of free edges is $index"
44     }
45
46     puts "Number of faults for the initial shape is $nb_a."
47     puts "Number of faults for the resulting shape is $nb_r."
48
49     #if nb_f is empty then it is instaility.
50     if { [string compare "$nb_f" ""] == 0 || $nb_f > 0 } {
51       set os "ALL"
52       if {[array get env os_type] != ""} {
53         set os $env(os_type)
54       }
55       puts "TODO #23150 $os: Error : Number of faults is $nb_f"
56     }
57     if { $nb_r > $nb_a } {
58       puts "Error : Number of faults is $nb_r"
59     }
60   } else { 
61     puts "Error : OPERATION FAILED"
62   }
63   clear
64   smallview
65   donly result
66   checkshape result
67   fit
68   xwd $imagedir/${test_image}.png
69 } else {
70   puts "Error : The sewing cannot be built."
71 }
72
73 puts "TEST COMPLETED"