Restoring test cases removed by last commit.
[occt.git] / tests / bugs / moddata / buc60897
CommitLineData
0e94a94e 1puts "========"
2puts "BUC60897"
3puts "========"
4
5pload QAcommands
6
7if [catch { set result [BUC60897] } ] {
8 puts "BUC60897: Error; (case 1)"
9} else {
10 set len [llength ${result}]
11 if {${len} < 21} {
12 puts "length = ${len}"
13 puts "BUC60897: Error; (case 2)"
14 } else {
15 set circle_X [lindex ${result} 3]
16 set circle_Y [lindex ${result} 5]
17 set circle_R [lindex ${result} 7]
18 set tangency1_X [lindex ${result} 11]
19 set tangency1_Y [lindex ${result} 13]
20 set tangency2_X [lindex ${result} 17]
21 set tangency2_Y [lindex ${result} 19]
22
23 set x1 [expr abs(${tangency1_X} - ${circle_X})]
24 set y1 [expr abs(${tangency1_Y} - ${circle_Y})]
25 set R1 [expr sqrt(${x1} * ${x1} + ${y1} * ${y1})]
26
27 set x2 [expr abs(${tangency2_X} - ${circle_X})]
28 set y2 [expr abs(${tangency2_Y} - ${circle_Y})]
29 set R2 [expr sqrt(${x2} * ${x2} + ${y2} * ${y2})]
30
31 set maxdelta 1.0
32 set delta_R1 [expr abs(${R1} - ${circle_R}) / ${circle_R} * 100.]
33 set delta_R2 [expr abs(${R2} - ${circle_R}) / ${circle_R} * 100.]
34
35 if {${delta_R1} > ${maxdelta}} {
36 puts "circle_X = ${circle_X}"
37 puts "circle_Y = ${circle_Y}"
38 puts "circle_R = ${circle_R}"
39 puts "tangency1_X = ${tangency1_X}"
40 puts "tangency1_Y = ${tangency1_Y}"
41 puts "x1 = ${x1}"
42 puts "y1 = ${y1}"
43 puts "R1 = ${R1}"
44 puts "delta_R1 = ${delta_R1}"
45 puts "maxdelta = ${maxdelta}"
46 puts "BUC60897: Error; (case 3)"
47 } else {
48 puts "BUC60897: OK; (case 1)"
49 }
50
51 if {${delta_R2} > ${maxdelta}} {
52 puts "circle_X = ${circle_X}"
53 puts "circle_Y = ${circle_Y}"
54 puts "circle_R = ${circle_R}"
55 puts "tangency2_X = ${tangency2_X}"
56 puts "tangency2_Y = ${tangency2_Y}"
57 puts "x2 = ${x2}"
58 puts "y2 = ${y2}"
59 puts "R2 = ${R2}"
60 puts "delta_R2 = ${delta_R2}"
61 puts "maxdelta = ${maxdelta}"
62 puts "BUC60897: Error; (case 4)"
63 } else {
64 puts "BUC60897: OK; (case 2)"
65 }
66
67 }
68}
69
70set 3dviewer 0
71
72