0027531: Modeling Algorithms - Make the algorithm Approx_SameParameter more clear...
[occt.git] / tests / bugs / moddata_2 / bug22809_4
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 psphere a 100
12 scalexyz r2 a 2 1 1
13 line l -0.000001 0.0000000001 -100 0 0 1
14 BRepIntCS l r2
15
16 regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_1 ] full info1
17
18 # N.B. multiple result points are to be processed by other algorithms
19 # Now there are 2 result points
20 set info2 [ whatis brics_2 ]
21 set info2 [ whatis brics_2 ]
22 regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_2 ] full info2
23
24
25 set word1 [string compare $info1 "point"]
26 set word2 [string compare $info2 "point"]
27
28 set status_point 0
29 if { ${word1} == 0 && ${word2} == 0 } {
30     set status_point 0
31 } else {
32     set status_point 1
33 }
34
35 regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_3 ] full info3
36 set word3 [string compare $info3 "a"]
37
38 set status_nb 0
39 if { ${word3} == 0 } {
40     set status_nb 0
41 } else {
42     set status_nb 1
43     # N.B. multiple result points are to be processed by other algorithms
44     set status_nb 0
45 }
46
47 set dump1 [ dump brics_1 ]
48
49 regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump1 full x1 y1 z1
50
51 set good_x1 -1.000000000000000e-06
52 set good_y1 1.000000000000000e-10
53 set good_z1 -1.000000000000000e+02
54
55 checkreal "x1" ${x1} ${good_x1} 0 0.001
56 checkreal "y1" ${y1} ${good_y1} 0 0.001
57 checkreal "z1" ${z1} ${good_z1} 0 0.001
58
59 set dump2 [ dump brics_2 ]
60 # N.B. multiple result points are to be processed by other algorithms
61 set dump2 [ dump brics_2 ]
62
63 regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump2 full x2 y2 z2
64
65 set good_x2 -1.000000000000000e-06
66 set good_y2 1.000000000000000e-10
67 set good_z2 1.000000000000000e+02
68
69 checkreal "x2" ${x2} ${good_x2} 0 0.001
70 checkreal "y2" ${y2} ${good_y2} 0 0.001
71 checkreal "z2" ${z2} ${good_z2} 0 0.001
72
73 if { ${status_point} == 0 && ${status_nb} == 0 } {
74     puts "OK ${BugNumber}"
75 } else {
76     puts "Faulty ${BugNumber}"
77 }