File: bug22809_2

package info (click to toggle)
opencascade 7.9.2%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 301,924 kB
  • sloc: cpp: 1,523,264; tcl: 10,159; cs: 5,173; java: 1,554; sh: 1,342; ansic: 827; xml: 699; makefile: 30; javascript: 22
file content (92 lines) | stat: -rwxr-xr-x 2,802 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
puts "============"
puts "OCC22809"
puts "============"
puts ""
############################################################################################################
# BRepIntCS does not find intersections of an ellipsoid and a line passing through it's apex
###########################################################################################################
# 
# Test was corrected. See:
# 
# http://tracker.dev.opencascade.org/view.php?id=23248
# pkv (developer)
# 2012-07-12 09:33
# The checking can not provide stable result because there is no guarantee that coordinates
# for brics_1 will always be {x1, y1, z1} but not {x2, y2, z2} and
# for brics_42 will always be {x2, y2, z2} but not {x1, y1, z1}.
# The coordinates of brics_1 can be both {x1, y1, z1} and {x2, y2, z2}
# The coordinates of brics_42 can be both {x1, y1, z1} and {x2, y2, z2} 
# 
###########################################################################################################

set BugNumber OCC22809

psphere a 100
scalexyz r2 a 2 1 1
line l 0 0 -100 0 0 1
BRepIntCS l r2

regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_1 ] full info1

# N.B. multiple result points are to be processed by other algorithms
# Now there are 130 result points
regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_23 ] full info2

set word1 [string compare $info1 "point"]
set word2 [string compare $info2 "point"]

set status_point 0
if { ${word1} == 0 && ${word2} == 0 } {
    set status_point 0
} else {
    set status_point 1
}

regexp {.* is a ([A-Za-z0-9]*)} [ whatis brics_3 ] full info3
set word3 [string compare $info3 "a"]

set status_nb 0
if { ${word3} == 0 } {
    set status_nb 0
} else {
    set status_nb 1
    # N.B. multiple result points are to be processed by other algorithms
    set status_nb 0
}

set good_x1 0.000000000000000e+00
set good_y1 0.000000000000000e+00
set good_z1 -1.000000000000000e+02

set good_x2 0.000000000000000e+00
set good_y2 0.000000000000000e+00
set good_z2 1.000000000000000e+02

set dump1 [ dump brics_1 ]

regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump1 full x1 y1 z1

checkreal "x1" ${x1} ${good_x1} 0 0.001
checkreal "y1" ${y1} ${good_y1} 0 0.001

if { abs ($z1 - $good_z1) > 0.001 * abs ($good_z1) } {
  checkreal "z1" ${z1} ${good_z2} 0 0.001
}

set dump2 [ dump brics_2 ]
# N.B. multiple result points are to be processed by other algorithms
set dump2 [ dump brics_23 ]
regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump2 full x2 y2 z2

checkreal "x2" ${x2} ${good_x2} 0 0.001
checkreal "y2" ${y2} ${good_y2} 0 0.001

if { abs ($z2 - $good_z2) > 0.001 * abs ($good_z2) } {
  checkreal "z2" ${z2} ${good_z1} 0 0.001
}

if { ${status_point} == 0 && ${status_nb} == 0 } {
    puts "OK ${BugNumber}"
} else {
    puts "Faulty ${BugNumber}"
}