3bea4c16 |
1 | puts "============" |
2 | puts "OCC22809" |
3 | puts "============" |
4 | puts "" |
5 | ############################################################################################################ |
6 | # BRepIntCS does not find intersections of an ellipsoid and a line passing through it's apex |
7 | ########################################################################################################### |
8 | |
9 | set BugNumber OCC22809 |
10 | |
11 | # |
12 | proc GetPercent {Value GoodValue} { |
13 | set Percent 0. |
14 | if {${GoodValue} != 0.} { |
15 | set Percent [expr abs(${Value} - ${GoodValue}) / abs(double(${GoodValue})) * 100.] |
16 | } elseif {${Value} != 0.} { |
17 | set Percent [expr abs(${GoodValue} - ${Value}) / abs(double(${Value})) * 100.] |
18 | } else { |
19 | set Percent 0. |
20 | } |
21 | return ${Percent} |
22 | } |
23 | |
24 | set percent_max 0.1 |
25 | # |
26 | |
27 | psphere a 100 |
28 | nurbsconvert r1 a |
29 | line l -0.000001 0.0000000001 -100 0 0 1 |
30 | BRepIntCS l r1 |
31 | |
32 | regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_1] full info1 |
33 | |
34 | # N.B. multiple result points are to be processed by other algorithms |
35 | # Now there are 3 result points |
36 | regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_2 ] full info2 |
37 | |
38 | set word1 [string compare $info1 "point"] |
39 | set word2 [string compare $info2 "point"] |
40 | |
41 | set status_point 0 |
42 | if { ${word1} == 0 && ${word2} == 0 } { |
43 | set status_point 0 |
44 | } else { |
45 | set status_point 1 |
46 | } |
47 | |
48 | regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_3 ] full info3 |
49 | set word3 [string compare $info3 "a"] |
50 | |
51 | set status_nb 0 |
52 | if { ${word3} == 0 } { |
53 | set status_nb 0 |
54 | } else { |
55 | set status_nb 1 |
56 | # N.B. multiple result points are to be processed by other algorithms |
57 | set status_nb 0 |
58 | } |
59 | |
60 | set dump1 [ dump brics_1 ] |
61 | |
62 | regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump1 full x1 y1 z1 |
63 | |
64 | set good_x1 -1.000000000000000e-06 |
65 | set good_y1 1.000000000000000e-10 |
66 | set good_z1 -1.000000000000000e+02 |
67 | |
68 | set status_xyz1 0 |
69 | set x1_percent [GetPercent ${x1} ${good_x1}] |
70 | puts "x1_percent = ${x1_percent}" |
71 | if { ${x1_percent} > ${percent_max} } { |
72 | puts "x1: Faulty ${BugNumber}" |
73 | set status_xyz1 1 |
74 | } else { |
75 | puts "x1: OK ${BugNumber}" |
76 | } |
77 | |
78 | set y1_percent [GetPercent ${y1} ${good_y1}] |
79 | puts "y1_percent = ${y1_percent}" |
80 | if { ${y1_percent} > ${percent_max} } { |
81 | puts "y1: Faulty ${BugNumber}" |
82 | set status_xyz1 1 |
83 | } else { |
84 | puts "y1: OK ${BugNumber}" |
85 | } |
86 | |
87 | set z1_percent [GetPercent ${z1} ${good_z1}] |
88 | puts "z1_percent = ${z1_percent}" |
89 | if { ${z1_percent} > ${percent_max} } { |
90 | puts "z1: Faulty ${BugNumber}" |
91 | set status_xyz1 1 |
92 | } else { |
93 | puts "z1: OK ${BugNumber}" |
94 | } |
95 | |
96 | set dump2 [ dump brics_2 ] |
97 | # N.B. multiple result points are to be processed by other algorithms |
98 | set dump2 [ dump brics_2 ] |
99 | |
100 | regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump2 full x2 y2 z2 |
101 | |
102 | set good_x2 -1.000000000000000e-06 |
103 | set good_y2 1.000000000000000e-10 |
104 | set good_z2 1.000000000000000e+02 |
105 | |
106 | set status_xyz2 0 |
107 | set x2_percent [GetPercent ${x2} ${good_x2}] |
108 | puts "x2_percent = ${x2_percent}" |
109 | if { ${x2_percent} > ${percent_max} } { |
110 | puts "x2: Faulty ${BugNumber}" |
111 | set status_xyz2 1 |
112 | } else { |
113 | puts "x2: OK ${BugNumber}" |
114 | } |
115 | |
116 | set y2_percent [GetPercent ${y2} ${good_y2}] |
117 | puts "y2_percent = ${y2_percent}" |
118 | if { ${y2_percent} > ${percent_max} } { |
119 | puts "y2: Faulty ${BugNumber}" |
120 | set status_xyz2 1 |
121 | } else { |
122 | puts "y2: OK ${BugNumber}" |
123 | } |
124 | |
125 | set z2_percent [GetPercent ${z2} ${good_z2}] |
126 | puts "z2_percent = ${z2_percent}" |
127 | if { ${z2_percent} > ${percent_max} } { |
128 | puts "z2: Faulty ${BugNumber}" |
129 | set status_xyz2 1 |
130 | } else { |
131 | puts "z2: OK ${BugNumber}" |
132 | } |
133 | |
134 | # Resume |
135 | puts "" |
136 | if { ${status_point} == 0 && ${status_nb} == 0 && ${status_xyz1} == 0 && ${status_xyz2} == 0 } { |
137 | puts "OK ${BugNumber}" |
138 | } else { |
139 | puts "Faulty ${BugNumber}" |
140 | } |
141 | |