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 | nurbsconvert r1 a |
26 | line l 0 0 -100 0 0 1 |
27 | BRepIntCS l r1 |
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 241 result points |
33 | regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_2 ] full info2 |
34 | regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_41 ] full info2 |
35 | |
36 | set word1 [string compare $info1 "point"] |
37 | set word2 [string compare $info2 "point"] |
38 | |
39 | set status_point 0 |
40 | |
3bea4c16 |
41 | if { ${word1} == 0 && ${word2} == 0 } { |
42 | set status_point 0 |
43 | } else { |
44 | set status_point 1 |
45 | } |
46 | |
47 | regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_3 ] full info3 |
48 | set word3 [string compare $info3 "a"] |
49 | |
50 | set status_nb 0 |
51 | if { ${word3} == 0 } { |
52 | set status_nb 0 |
53 | } else { |
54 | set status_nb 1 |
55 | # N.B. multiple result points are to be processed by other algorithms |
56 | set status_nb 0 |
57 | } |
58 | |
59 | set good_x1 0.000000000000000e+00 |
60 | set good_y1 0.000000000000000e+00 |
61 | set good_z1 -1.000000000000000e+02 |
62 | |
63 | set good_x2 0.000000000000000e+00 |
64 | set good_y2 0.000000000000000e+00 |
65 | set good_z2 1.000000000000000e+02 |
66 | |
67 | set dump1 [ dump brics_1 ] |
68 | regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump1 full x1 y1 z1 |
69 | |
cd718a73 |
70 | checkreal "x1" ${x1} ${good_x1} 0 0.001 |
71 | checkreal "y1" ${y1} ${good_y1} 0 0.001 |
3bea4c16 |
72 | |
cd718a73 |
73 | if { abs ($z1 - $good_z1) > 0.001 * abs ($good_z1) } { |
74 | checkreal "z1" ${z1} ${good_z2} 0 0.001 |
3bea4c16 |
75 | } |
76 | |
77 | set dump2 [ dump brics_2 ] |
78 | # N.B. multiple result points are to be processed by other algorithms |
79 | set dump2 [ dump brics_41 ] |
80 | regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump2 full x2 y2 z2 |
81 | |
cd718a73 |
82 | checkreal "x2" ${x2} ${good_x2} 0 0.001 |
83 | checkreal "y2" ${y2} ${good_y2} 0 0.001 |
3bea4c16 |
84 | |
cd718a73 |
85 | if { abs ($z2 - $good_z2) > 0.001 * abs ($good_z2) } { |
86 | checkreal "z2" ${z2} ${good_z1} 0 0.001 |
3bea4c16 |
87 | } |
88 | |
cd718a73 |
89 | if { ${status_point} == 0 && ${status_nb} == 0 } { |
3bea4c16 |
90 | puts "OK ${BugNumber}" |
91 | } else { |
92 | puts "Faulty ${BugNumber}" |
93 | } |