Restoring test cases removed by last commit.
[occt.git] / tests / bugs / moddata / bug165_3
CommitLineData
0e94a94e 1
2puts "========"
3puts "OCC165"
4puts "========"
5
6restore [locate_data_file OCC165-2.brep] f
7puts [checkshape f]
8
9set IsGood 1
10if [catch {mkoffset res1 f 3 10 } result] {
11 puts "Faulty OCC165 (case 1) : function MKOFFSET works wrongly"
12 set IsGood 0
13} else {
14 #puts "OCC165 OK (case 1): function MKOFFSET works properly"
15 mkplane pl1_1 res1_1
16 puts [checkshape pl1_1]
17 mkplane pl1_2 res1_2
18 puts [checkshape pl1_2]
19 mkplane pl1_3 res1_3
20 puts [checkshape pl1_3]
21}
22
23if [catch {mkoffset res2 f 3 -10 } result] {
24 puts "Faulty OCC165 (case 2) : function MKOFFSET works wrongly"
25 set IsGood 0
26} else {
27 #puts "OCC165 OK (case 2): function MKOFFSET works properly"
28 mkplane pl2_1 res2_1
29 puts [checkshape pl2_1]
30 mkplane pl2_2 res2_2
31 puts [checkshape pl2_2]
32 mkplane pl2_3 res2_3
33 puts [checkshape pl2_3]
34}
35
36if {$IsGood == 1} {
37 compound f res1_1 res1_2 res1_3 res2_1 res2_2 res2_3 res
38
39 regexp {Mass +: +([-0-9.+eE]+)} [lprops res1_1] full len
40
41 set good_len 462.832
42 set percent_max 0.1
43 set percent [expr abs(${len} - ${good_len}) / double(${good_len}) * 100.]
44
45 puts "good_len = ${good_len}"
46 puts "length = ${len}"
47 puts "percent = ${percent}"
48
49 if {${percent} > ${percent_max}} {
50 puts "Faulty OCC165 (case 3) : function MKOFFSET works wrongly"
51 set IsGood 0
52 }
53
54 regexp {Mass +: +([-0-9.+eE]+)} [lprops res1_2] full len
55
56 set good_len 525.664
57 set percent_max 0.1
58 set percent [expr abs(${len} - ${good_len}) / double(${good_len}) * 100.]
59
60 puts "good_len = ${good_len}"
61 puts "length = ${len}"
62 puts "percent = ${percent}"
63
64 if {${percent} > ${percent_max}} {
65 puts "Faulty OCC165 (case 4) : function MKOFFSET works wrongly"
66 set IsGood 0
67 }
68
69 regexp {Mass +: +([-0-9.+eE]+)} [lprops res1_3] full len
70
71 set good_len 588.496
72 set percent_max 0.1
73 set percent [expr abs(${len} - ${good_len}) / double(${good_len}) * 100.]
74
75 puts "good_len = ${good_len}"
76 puts "length = ${len}"
77 puts "percent = ${percent}"
78
79 if {${percent} > ${percent_max}} {
80 puts "Faulty OCC165 (case 5) : function MKOFFSET works wrongly"
81 set IsGood 0
82 }
83
84 regexp {Mass +: +([-0-9.+eE]+)} [lprops res2_1] full len
85
86 set good_len 320
87 set percent_max 0.1
88 set percent [expr abs(${len} - ${good_len}) / double(${good_len}) * 100.]
89
90 puts "good_len = ${good_len}"
91 puts "length = ${len}"
92 puts "percent = ${percent}"
93
94 if {${percent} > ${percent_max}} {
95 puts "Faulty OCC165 (case 6) : function MKOFFSET works wrongly"
96 set IsGood 0
97 }
98
99 regexp {Mass +: +([-0-9.+eE]+)} [lprops res2_2] full len
100
101 set good_len 240
102 set percent_max 0.1
103 set percent [expr abs(${len} - ${good_len}) / double(${good_len}) * 100.]
104
105 puts "good_len = ${good_len}"
106 puts "length = ${len}"
107 puts "percent = ${percent}"
108
109 if {${percent} > ${percent_max}} {
110 puts "Faulty OCC165 (case 7) : function MKOFFSET works wrongly"
111 set IsGood 0
112 }
113
114 regexp {Mass +: +([-0-9.+eE]+)} [lprops res2_3] full len
115
116 set good_len 160
117 set percent_max 0.1
118 set percent [expr abs(${len} - ${good_len}) / double(${good_len}) * 100.]
119
120 puts "good_len = ${good_len}"
121 puts "length = ${len}"
122 puts "percent = ${percent}"
123
124 if {${percent} > ${percent_max}} {
125 puts "Faulty OCC165 (case 8) : function MKOFFSET works wrongly"
126 set IsGood 0
127 }
128
129 if {$IsGood == 1} {
130 puts "OCC165 OK"
131 } else {
132 puts "OCC165 FAULTY"
133 }
134
135} else {
136 puts "OCC165 FAULTY"
137}