f751596e |
1 | puts "============" |
2 | puts "OCC24623_1" |
3 | puts "============" |
4 | puts "" |
5 | ####################################################################### |
6 | puts "Visualization - improve selection mechanism" |
7 | # tests performance of selection algorithm. Creates a grid of spheres with |
8 | # size DISCRETISATION * DISCRETISATION. To get representative performance |
9 | # test results, increase the size of grid in DISCRETISATION and check time |
10 | # measurments in comparsion to previous OCCT versions. You may also check |
11 | # the time of selection when all BVH trees are built via uncommenting |
12 | # the code in "Start building all trees" section. |
13 | ####################################################################### |
14 | |
15 | set DISCRETISATION 10 |
16 | set RADIUS 100 |
17 | |
18 | pload ALL |
19 | |
20 | set aStep [expr $RADIUS * 0.1] |
21 | |
22 | # unset aNames |
23 | list aNames |
24 | set aX 0 |
25 | set aY 0 |
26 | for {set i 0} {$i < $DISCRETISATION} {incr i} { |
27 | for {set j 0} {$j < $DISCRETISATION} {incr j} { |
28 | set aCurrName "sph" |
29 | append aCurrName [expr $i * $DISCRETISATION + $j] |
30 | lappend aNames $aCurrName |
31 | psphere $aCurrName $RADIUS |
32 | set aX [expr $i * ($aStep + $RADIUS)] |
33 | set aY [expr - $j * ($aStep + $RADIUS)] |
34 | ttranslate $aCurrName $aX $aY 0 |
35 | } |
36 | } |
37 | |
38 | set aSpheresNbInfo "Total spheres number:" |
39 | append aSpheresNbInfo [expr $DISCRETISATION * $DISCRETISATION] |
40 | puts $aSpheresNbInfo |
41 | |
42 | vinit |
43 | set aMemInit [meminfo h] |
44 | puts "Initial mem: [expr $aMemInit / (1024 * 1024)] MiB ([expr $aMemInit])" |
45 | vsetdispmode 1 |
46 | set aMemInit [meminfo h] |
47 | vdisplay {*}$aNames |
48 | vfit |
49 | |
50 | puts "Selection of spheres without BVH trees built:" |
51 | chrono aTimer reset |
52 | chrono aTimer start |
53 | vmoveto 224 269 |
54 | chrono aTimer stop |
55 | chrono aTimer show |
56 | |
57 | puts "" |
58 | puts "Applying the transformations..." |
59 | vtranslateview 1 0 0 |
60 | vrotate 100 100 100 |
61 | |
62 | puts "" |
63 | puts "Selection time with transformations applied without BVH built:" |
64 | chrono aTimer reset |
65 | chrono aTimer start |
66 | vmoveto 102 224 |
67 | chrono aTimer stop |
68 | chrono aTimer show |
69 | |
70 | # puts "" |
71 | # puts "Start building all trees..." |
72 | # vtop |
73 | # vfit |
74 | # set aStartPt [expr round(400 / double($DISCRETISATION)) + 5] |
75 | # set aPtStep [expr round(double(round(100*(400 / double($DISCRETISATION))))/100 * 2)] |
76 | # for {set i 0} {$i < $DISCRETISATION / 2} {incr i} { |
77 | # for {set j 0} {$j < $DISCRETISATION / 2} {incr j} { |
78 | # set aX [expr $aStartPt + $i * $aPtStep] |
79 | # set aY [expr $aStartPt + $j * $aPtStep] |
80 | # vmoveto $aX $aY 1 |
81 | # } |
82 | # } |
83 | |
84 | # puts "" |
85 | # puts "Selection time with all BVHs built:" |
86 | # chrono aTimer reset |
87 | # chrono aTimer start |
88 | # vmoveto 200 200 |
89 | # chrono aTimer stop |
90 | # chrono aTimer show |
91 | |
92 | set aMemSel [meminfo h] |
93 | puts "Selection mem: [expr $aMemSel / (1024 * 1024)] MiB ([expr $aMemSel])" |
94 | |
95 | checkcolor 115 221 0 1 1 |