0027531: Modeling Algorithms - Make the algorithm Approx_SameParameter more clear...
[occt.git] / tests / bugs / moddata_2 / bug22809_2
CommitLineData
3bea4c16 1puts "============"
2puts "OCC22809"
3puts "============"
4puts ""
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
22set BugNumber OCC22809
23
3bea4c16 24psphere a 100
25scalexyz r2 a 2 1 1
26line l 0 0 -100 0 0 1
27BRepIntCS l r2
28
29regexp {.* 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
33regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_23 ] full info2
34
35set word1 [string compare $info1 "point"]
36set word2 [string compare $info2 "point"]
37
38set status_point 0
39if { ${word1} == 0 && ${word2} == 0 } {
40 set status_point 0
41} else {
42 set status_point 1
43}
44
45regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_3 ] full info3
46set word3 [string compare $info3 "a"]
47
48set status_nb 0
49if { ${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
57set good_x1 0.000000000000000e+00
58set good_y1 0.000000000000000e+00
59set good_z1 -1.000000000000000e+02
60
61set good_x2 0.000000000000000e+00
62set good_y2 0.000000000000000e+00
63set good_z2 1.000000000000000e+02
64
65set dump1 [ dump brics_1 ]
66
67regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump1 full x1 y1 z1
68
cd718a73 69checkreal "x1" ${x1} ${good_x1} 0 0.001
70checkreal "y1" ${y1} ${good_y1} 0 0.001
3bea4c16 71
cd718a73 72if { abs ($z1 - $good_z1) > 0.001 * abs ($good_z1) } {
73 checkreal "z1" ${z1} ${good_z2} 0 0.001
3bea4c16 74}
75
76set dump2 [ dump brics_2 ]
77# N.B. multiple result points are to be processed by other algorithms
78set dump2 [ dump brics_23 ]
79regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump2 full x2 y2 z2
80
cd718a73 81checkreal "x2" ${x2} ${good_x2} 0 0.001
82checkreal "y2" ${y2} ${good_y2} 0 0.001
3bea4c16 83
cd718a73 84if { abs ($z2 - $good_z2) > 0.001 * abs ($good_z2) } {
85 checkreal "z2" ${z2} ${good_z1} 0 0.001
3bea4c16 86}
87
cd718a73 88if { ${status_point} == 0 && ${status_nb} == 0 } {
3bea4c16 89 puts "OK ${BugNumber}"
90} else {
91 puts "Faulty ${BugNumber}"
92}