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 | # Test was corrected. See: |
10 | # |
11 | # http://tracker.dev.opencascade.org/view.php?id=23248 |
12 | # pkv (developer) |
13 | # 2012-07-12 09:33 |
14 | # The checking can not provide stable result because there is no guarantee that coordinates |
15 | # for brics_1 will always be {x1, y1, z1} but not {x2, y2, z2} and |
16 | # for brics_42 will always be {x2, y2, z2} but not {x1, y1, z1}. |
17 | # The coordinates of brics_1 can be both {x1, y1, z1} and {x2, y2, z2} |
18 | # The coordinates of brics_42 can be both {x1, y1, z1} and {x2, y2, z2} |
19 | # |
20 | ########################################################################################################### |
21 | |
22 | set BugNumber OCC22809 |
23 | |
3bea4c16 |
24 | psphere a 100 |
25 | scalexyz r2 a 2 1 1 |
26 | line l 0 0 -100 0 0 1 |
27 | BRepIntCS l r2 |
28 | |
29 | regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_1 ] full info1 |
30 | |
31 | # N.B. multiple result points are to be processed by other algorithms |
32 | # Now there are 130 result points |
33 | regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_23 ] full info2 |
34 | |
35 | set word1 [string compare $info1 "point"] |
36 | set word2 [string compare $info2 "point"] |
37 | |
38 | set status_point 0 |
39 | if { ${word1} == 0 && ${word2} == 0 } { |
40 | set status_point 0 |
41 | } else { |
42 | set status_point 1 |
43 | } |
44 | |
45 | regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_3 ] full info3 |
46 | set word3 [string compare $info3 "a"] |
47 | |
48 | set status_nb 0 |
49 | if { ${word3} == 0 } { |
50 | set status_nb 0 |
51 | } else { |
52 | set status_nb 1 |
53 | # N.B. multiple result points are to be processed by other algorithms |
54 | set status_nb 0 |
55 | } |
56 | |
57 | set good_x1 0.000000000000000e+00 |
58 | set good_y1 0.000000000000000e+00 |
59 | set good_z1 -1.000000000000000e+02 |
60 | |
61 | set good_x2 0.000000000000000e+00 |
62 | set good_y2 0.000000000000000e+00 |
63 | set good_z2 1.000000000000000e+02 |
64 | |
65 | set dump1 [ dump brics_1 ] |
66 | |
67 | regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump1 full x1 y1 z1 |
68 | |
cd718a73 |
69 | checkreal "x1" ${x1} ${good_x1} 0 0.001 |
70 | checkreal "y1" ${y1} ${good_y1} 0 0.001 |
3bea4c16 |
71 | |
cd718a73 |
72 | if { abs ($z1 - $good_z1) > 0.001 * abs ($good_z1) } { |
73 | checkreal "z1" ${z1} ${good_z2} 0 0.001 |
3bea4c16 |
74 | } |
75 | |
76 | set dump2 [ dump brics_2 ] |
77 | # N.B. multiple result points are to be processed by other algorithms |
78 | set dump2 [ dump brics_23 ] |
79 | regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump2 full x2 y2 z2 |
80 | |
cd718a73 |
81 | checkreal "x2" ${x2} ${good_x2} 0 0.001 |
82 | checkreal "y2" ${y2} ${good_y2} 0 0.001 |
3bea4c16 |
83 | |
cd718a73 |
84 | if { abs ($z2 - $good_z2) > 0.001 * abs ($good_z2) } { |
85 | checkreal "z2" ${z2} ${good_z1} 0 0.001 |
3bea4c16 |
86 | } |
87 | |
cd718a73 |
88 | if { ${status_point} == 0 && ${status_nb} == 0 } { |
3bea4c16 |
89 | puts "OK ${BugNumber}" |
90 | } else { |
91 | puts "Faulty ${BugNumber}" |
92 | } |