0025952: Wrong intersection curve
[occt.git] / tests / lowalgos / intss / bug23972
CommitLineData
3306fdd9 1puts "=========="
2puts "OCC23972: Excep-tion thrown when intersecting two cones"
3puts "=========="
4puts ""
5
6pload QAcommands
7
8set GoodNbCurv 2
9
10OCC23972 s1 s2
11
12intersect res s1 s2
13
14set che [whatis res]
15set ind [string first "3d curve" $che]
16if {${ind} >= 0} {
17 #Only variable "res" exists
18 renamevar res res_1
19}
20
21set ic 1
22set AllowRepeat 1
23while { $AllowRepeat != 0 } {
24 set che [whatis res_$ic]
25 set ind [string first "3d curve" $che]
26 if {${ind} < 0} {
27 set AllowRepeat 0
28 } else {
29
30 bounds res_$ic U1 U2
31
32 # Hyperbola is expected as intersection result.
33 # So, all bounds are adjusted to allow correct computation.
34 if { [dval U1] < -20.0 } { dset U1 -20.0 }
35 if { [dval U2] > 20.0 } { dset U2 20.0 }
36
37 if {[dval U2-U1] < 1.0e-20} {
38 puts "Error: Wrong curve's range!"
39 }
40
41 xdistcs res_$ic s1 U1 U2 10 3.0e-7
42 xdistcs res_$ic s2 U1 U2 10 3.0e-7
43
44 incr ic
45 }
46}
47
48if {[expr {$ic - 1}] == $GoodNbCurv} {
49 puts "OK: Number of curves is good!"
50} else {
51 puts "Error: Number of curves is bad!"
52}