0023178: Intersection of cylinders fails to produce results
[occt.git] / tests / bugs / modalg_5 / bug25742_2
1 puts "============"
2 puts "OCC25742"
3 puts "============"
4 puts ""
5 ###############################
6 ## A partition of 2 shapes stresses a performance issue
7 ###############################
8
9 if { [regexp {Debug mode} [dversion]] } {
10   if { [regexp {Windows} [dversion]] } {
11     set max_time 10
12     set max_time2 10
13   } else {
14     set max_time 10
15     set max_time2 10
16   }
17 } else {
18   if { [regexp {Windows} [dversion]] } {
19     set max_time 1
20     set max_time2 1
21   } else {
22     set max_time 1
23     set max_time2 1
24   }
25 }
26
27 restore [locate_data_file bug25742_pipeFiss.brep] b1
28 restore [locate_data_file bug25742_shellFiss.brep] b2
29
30 explode b1 f
31 explode b2 f
32
33 smallview
34 donly b1_4
35 fit
36 display b2_1
37
38 dchrono h reset
39 dchrono h start
40
41 bopcurves b1_4 b2_1 -2d
42
43 dchrono h stop
44
45 checkview -screenshot -2d -path ${imagedir}/${test_image}_1.png
46
47 set q [dchrono h show]
48
49 regexp {CPU user time: ([-0-9.+eE]+) seconds} $q full z
50 puts "$z"
51
52 if { $z > ${max_time} } {
53     puts "Elapsed time of bopcurves is more than ${max_time} seconds - Error"
54 } else {
55     puts "Elapsed time of bopcurves is less than ${max_time} seconds - OK"
56 }
57
58
59 mksurface s1 b1_4
60 mksurface s2 b2_1
61
62 dchrono h2 reset
63 dchrono h2 start
64
65 set CurveNumb [intersect resi s1 s2]
66
67 dchrono h2 stop
68 set q2 [dchrono h2 show]
69
70 regexp {CPU user time: ([-0-9.+eE]+) seconds} $q2 full z2
71 puts "$z2"
72
73 if { $z2 > ${max_time2} } {
74     puts "Elapsed time of intersect is more than ${max_time2} seconds - Faulty"
75 } else {
76     puts "Elapsed time of intersect is less than ${max_time2} seconds - OK"
77 }
78
79 if { [llength ${CurveNumb}] < 1 } {
80     puts "Error : Bad intersection"
81 } else {
82     puts "OK : Good intersection"
83 }
84
85 don resi*
86 fit
87 display s1 s2
88
89 checkview -screenshot -2d -path ${imagedir}/${test_image}_2.png