1a0339b4 |
1 | puts "========" |
2 | puts "OCC29311" |
3 | puts "========" |
4 | puts "" |
5 | ################################################# |
6 | # Implementation of the Oriented Bounding Boxes (OBB) functionality |
7 | ################################################# |
8 | |
9 | set NbIters 101 |
10 | set step [expr 360.0/($NbIters-1) ] |
11 | |
12 | restore [locate_data_file bug29237_no_overlap.lhs.brep] a |
13 | |
14 | # Create AABB for a and put it into "r1" variable |
15 | # Draw[]> bounding -s a -shape r1 |
16 | # The volume of one AABB is |
17 | # Draw[]> vprops r1 1.0e-12 -full |
18 | # 32736000.276308119 |
19 | set Vexp 32736000.276308119 |
20 | |
21 | set VMax 0 |
22 | set MaxIteration 0 |
23 | |
24 | for {set i 1} { $i <= $NbIters} { incr i } { |
25 | bounding -s 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 { $i != $NbIters } { trotate a 283 162 317 2 7 9 $step } |
36 | } |
37 | |
38 | set aDeltaMax [ expr 100.0*abs($VMax/$Vexp - 1.0) ] |
39 | |
40 | puts "Delta of computation not greater than $aDeltaMax %. Maximal delta is achieved in $MaxIteration iteration. See \"amax\" shape." |
41 | |
42 | if { $aDeltaMax > 0.1 } { |
43 | puts "Error: The obtained OBB(s) is not precise." |
44 | } |
45 | |
46 | axo |
47 | donly amax rr${MaxIteration} |
48 | fit |
49 | checkview -screenshot -2d -path ${imagedir}/${test_image}.png |