0024174: [regression] BRepBuilderAPI_Sewing returns result with very high tolerance
[occt.git] / tests / sewing / end
CommitLineData
40093367 1set cs_a [checkshape a]
2puts "checkshape a"
3if { [info exists nb_f] == 0 } {
4 set nb_f 0
5}
6if { $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
16set exp [explode a f]
17set L [concat compound $exp C]
18eval $L
19puts [whatis C]
20puts [sewing result $tol C]
21
22if { [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 catch {freebounds $result -0.01}
38 set s [explode result_c e]
39 puts $s
40 set index [ llength $s ]
41 if { $index != 0 } {
42 puts "Error : Number of free edges is $index"
43 }
44
94a57f1f 45 puts "Number of faults for the initial shape is $nb_a."
46 puts "Number of faults for the resulting shape is $nb_r."
40093367 47
48 #if nb_f is empty then it is instaility.
49 if { [string compare "$nb_f" ""] == 0 || $nb_f > 0 } {
50 set os "ALL"
51 if {[array get env os_type] != ""} {
52 set os $env(os_type)
53 }
94a57f1f 54 puts "TODO #23150 $os: Error : Number of faults is $nb_f"
40093367 55 }
56 if { $nb_r > $nb_a } {
94a57f1f 57 puts "Error : Number of faults is $nb_r"
40093367 58 }
59 } else {
60 puts "Error : OPERATION FAILED"
61 }
62 clear
63 smallview
64 donly result
65 checkshape result
66 fit
88f8fc81 67 xwd $imagedir/${test_image}.png
40093367 68} else {
94a57f1f 69 puts "Error : The sewing cannot be built."
40093367 70}
71
72puts "TEST COMPLETED"