Restoring test cases removed by last commit.
[occt.git] / tests / bugs / moddata / bug88
CommitLineData
0e94a94e 1puts "========"
2puts "BUC60963"
3puts "OCC88"
4puts "========"
5puts ""
6######################################################
7# BUC60963. can not project vertex to face
8######################################################
9
10restore [locate_data_file OCC88.brep] sh
11
12set che [checkshape sh]
13
14explode sh f
15puts [checkshape sh_1]
16puts [checkshape sh_2]
17
18mksurface surf1 sh_1
19mksurface surf2 sh_2
20puts "Make line from pos(135; 11; 0) with dir (0;0;1) "
21line l 135 11 0 0 0 1
22
23intersect res1 l surf1
24intersect res2 l surf2
25#set first1 [whatis res1]
26#set second1 [whatis res2]
27
28puts "Try to intersect with (135;10.9995;0) (0;0;1)"
29line ll 135 10.9995 0 0 0 1
30intersect res_1 ll surf1
31intersect res_2 ll surf2
32#set first2 [whatis res_1]
33#set second2 [whatis res_2]
34
35proc CalculatePercent {value good_value} {
36 if {${good_value} == 0. && ${value} == 0.} {
37 set percent 0.
38 } else {
39 set percent [expr abs(${value} - ${good_value}) / double(${good_value}) * 100.]
40 }
41 return ${percent}
42}
43
44set IsGood 1
45set percent_max 0.1
46if {[info exists res1] == 0} {
47 puts "Faulty OCC88 (case 2)"
48 set IsGood 0
49}
50if {[info exists res2] == 1} {
51 puts "Faulty OCC88 (case 3)"
52 set IsGood 0
53}
54
55if {[info exists res_1] == 0} {
56 puts "Faulty OCC88 (case 4)"
57 set IsGood 0
58}
59if {[info exists res_2] == 1} {
60 puts "Faulty OCC88 (case 5)"
61 set IsGood 0
62}
63
64if {${IsGood} == 1} {
65 set dump_list1 [split [dump res1] " :,\n"]
66 set x1 [lindex ${dump_list1} 10]
67 set y1 [lindex ${dump_list1} 12]
68 set z1 [lindex ${dump_list1} 14]
69
70 set dump_list2 [split [dump res_1] " :,\n"]
71 set x2 [lindex ${dump_list2} 10]
72 set y2 [lindex ${dump_list2} 12]
73 set z2 [lindex ${dump_list2} 14]
74
75 set x_percent [CalculatePercent ${x1} ${x2}]
76 set y_percent [CalculatePercent ${y1} ${y2}]
77 set z_percent [CalculatePercent ${z1} ${z2}]
78
79 puts "x1 = ${x1}"
80 puts "x2 = ${x2}"
81 puts "x_percent = ${x_percent}\n"
82
83 puts "y1 = ${y1}"
84 puts "y2 = ${y2}"
85 puts "y_percent = ${y_percent}\n"
86
87 puts "z1 = ${z1}"
88 puts "z2 = ${z2}"
89 puts "z_percent = ${z_percent}\n"
90
91 if {${x_percent} > ${percent_max}} {
92 puts "OCC88 Faulty (case 6)"
93 set IsGood 0
94 }
95 if {${y_percent} > ${percent_max}} {
96 puts "OCC88 Faulty (case 7)"
97 set IsGood 0
98 }
99 if {${z_percent} > ${percent_max}} {
100 puts "OCC88 Faulty (case 8)"
101 set IsGood 0
102 }
103}
104
105if {${IsGood} == 1} {
106 puts "OCC88 OK"
107}
108
109