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