0029967: Draw Harness - command bounding has annoying syntax
[occt.git] / tests / bugs / modalg_7 / bug29311_17
... / ...
CommitLineData
1puts "========"
2puts "OCC29311"
3puts "========"
4puts ""
5#################################################
6# Implementation of the Oriented Bounding Boxes (OBB) functionality
7#################################################
8
9
10set NbIters 31
11set step [expr 360.0/($NbIters-1) ]
12
13restore [locate_data_file OCC26443-shell_2.brep] a
14
15# Check DiTo-algorithm
16incmesh a 0.01
17
18set VMax -1.0e200
19set VMin 1.0e200
20
21set MaxIteration 0
22set MinIteration 0
23
24for {set i 1} { $i <= $NbIters} { incr i } {
25 bounding a -obb -shape rr$i
26
27 regexp {Mass +: +([-0-9.+eE]+)} [vprops rr$i 1.0e-12 -full] full Vreal
28
29 if { $Vreal > $VMax } {
30 set VMax $Vreal
31 set MaxIteration $i
32 copy a amax
33 }
34
35 if { $Vreal < $VMin } {
36 set VMin $Vreal
37 set MinIteration $i
38 copy a amin
39 }
40
41 if { $i != $NbIters } { trotate a 283 162 317 2 7 9 $step }
42}
43
44checkreal {Transformed BndBoxes} $VMax $VMin 0.0 0.3
45
46puts "The box with maximal volume is achieved in $MaxIteration iteration. See \"amax\" shape."
47puts "The box with minimal volume is achieved in $MinIteration iteration. See \"amin\" shape."
48
49bounding amax -obb -dump
50bounding amin -obb -dump
51