0014531: Boolean Operation Algorithm fails
[occt.git] / tests / bugs / modalg_5 / bug25788
CommitLineData
0090ae85 1puts "========="
2puts "OCC25788"
3puts "========="
4puts ""
5###############################################
6# Parallelization of the BOP Builder algorithm on second level
7###############################################
8
9# box plate to cut the holes from
10box b1 100 100 1
11
12# N defines number of holes along each of X and Y, thus total N^2 holes
13# will be drilled; note that the algorithm iself is likely to be quadratic
14# for number of shapes, i.e. CPU
15set N 40
16set holes {}
17for {set i 1} {$i < $N} {incr i} {
18 for {set j 1} {$j < $N} {incr j} {
19 pcylinder p_${i}_$j 0.5 1
20 ttranslate p_${i}_$j [expr $i * 100. / $N] [expr $j * 100. / $N] 0.
21 lappend holes p_${i}_$j
22 }
23}
24
25eval compound $holes b2
26
27bclearobjects
28bcleartools
29baddobjects b1
30baddtools b2
31
32brunparallel 1
33
34dchrono cpu reset
35dchrono cpu start
36bcut r b1 b2
37dchrono cpu stop
38set chrono_info [dchrono cpu show]
39
40if { [regexp {Debug mode} [dversion]] } {
41 if { [regexp {Windows} [dversion]] } {
42 set max_time 200
43 } else {
44 set max_time 200
45 }
46} else {
47 if { [regexp {Windows} [dversion]] } {
48 set max_time 50
49 } else {
50 set max_time 50
51 }
52}
53
54regexp {CPU user time: ([-0-9.+eE]+) seconds} ${chrono_info} full z
55puts "$z"
56
57if { $z > ${max_time} } {
58 puts "Elapsed time is more than ${max_time} seconds - Faulty"
59} else {
60 puts "Elapsed time is less than ${max_time} seconds - OK"
61}