0025952: Wrong intersection curve
[occt.git] / tests / lowalgos / intss / bug26894
CommitLineData
e146ef9a 1puts "================"
2puts "OCC26894"
3puts "================"
4puts ""
5#######################################################################
6# Intersection algorithm between two infinite cylinders is hanging
7#######################################################################
8
9# Attention!!!
10# The test on performance meter.
11# On the MASTER it takes:
12# Elapsed time: 0 Hours 0 Minutes 6.3723911111 Seconds
13# CPU user time: 6.15625 seconds
14# CPU system time: 0.0625 seconds
15
16# The intersection curve is almost infinite.
17# Therefore, we must have failed to return
18# any section curve (see comments to the issue #26894).
19set GoodNbCurv 0
20
21restore [locate_data_file bug26884-f1.brep] f1
22restore [locate_data_file bug26884-f2.brep] f2
23
24mksurface ss1 f1
25mksurface ss2 f2
26
27if { ![ catch {intersect result ss1 ss2 } ] } {
28 puts "Error: intersection algorithm must return fail status. But it is not."
29}
30
31set che [whatis result]
32set ind [string first "3d curve" $che]
33if {${ind} >= 0} {
34 #Only variable "result" exists
35 renamevar result result_1
36}
37
38set ic 1
39set AllowRepeate 1
40while { $AllowRepeate != 0 } {
41 set che [whatis result_$ic]
42 set ind [string first "3d curve" $che]
43 if {${ind} < 0} {
44 set AllowRepeate 0
45 } else {
46 display result_$ic
47
48 bounds result_$ic U1 U2
49
50 dump U1 U2
51
52 if {[dval U2-U1] < 1.0e-9} {
53 puts "Error: Wrong curve's range!"
54 }
55
56 xdistcs result_$ic ss1 U1 U2 10 1.0e-7
57 xdistcs result_$ic ss2 U1 U2 10 1.0e-7
58
59 incr ic
60 }
61}
62
63if {[expr {$ic - 1}] == $GoodNbCurv} {
64 puts "OK: Number of curves is good!"
65} else {
66 puts "Error: $GoodNbCurv is expected but [expr {$ic - 1}] is found!"
67}