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