0031304: Configuration - TKACIS building failure due to duplicated symbol GeomFillFus...
[occt.git] / tests / bugs / modalg_7 / bug30595_3
CommitLineData
1bb67d38 1puts "==============================================================="
2puts "0030595: Oriented Bounding Box seems not optimal for some shapes"
3puts "==============================================================="
4puts ""
5
6# test is the copy of the test case bug29311_2
7# but computing the optimal OBB comparing to tight AABB
8# with 1.e-6% precision
9
10set NbIters 101
11set step [expr 360.0/($NbIters-1) ]
12
13restore [locate_data_file bug29237_no_overlap.rhs.brep] a
14
15# Create AABB for a and put it into "r1" variable
16# Draw[]> bounding a -shape r1
17# The volume of one AABB is
18# Draw[]> vprops r1 1.0e-12 -full
19# 32736000.184203226
20set Vexp 32736000.184203226
21
22set VMax 0
23set MaxIteration 0
24
25for {set i 1} { $i <= $NbIters} { incr i } {
26 bounding a -obb -shape rr$i -optimal
27
28 regexp {Mass +: +([-0-9.+eE]+)} [vprops rr$i 1.0e-12 -full] full Vreal
29
30 if { $Vreal > $VMax } {
31 set VMax $Vreal
32 set MaxIteration $i
33 copy a amax
34 }
35
36 if { $i != $NbIters } { trotate a 283 162 317 2 7 9 $step }
37}
38
39set aDeltaMax [ expr 100.0*abs($VMax/$Vexp - 1.0) ]
40
41puts "Delta of computation not greater than $aDeltaMax %. Maximal delta is achieved in $MaxIteration iteration. See \"amax\" shape."
42
43if { $aDeltaMax > 1.e-6 } {
44 puts "Error: The obtained OBB(s) is not precise."
45}
46
47smallview
48donly amax rr${MaxIteration}
49fit
50checkview -screenshot -2d -path ${imagedir}/${test_image}.png