f751596e |
1 | puts "============" |
2 | puts "OCC24623_2" |
3 | puts "============" |
4 | puts "" |
5 | ####################################################################### |
6 | puts "Visualization - improve selection mechanism" |
7 | # tests performance of selection algorithm. Creates a spiral via polyline |
8 | # and checks its selection in neutral point. For representative result, |
9 | # increase the number of points in POINTS_NUM and check time measurments |
10 | # in comparsion to previous OCCT versions. |
11 | ####################################################################### |
12 | |
13 | set POINTS_NUM 1000 |
14 | set STEP 0.3 |
15 | |
16 | pload ALL |
17 | |
18 | set aCoef 0.2 |
19 | set aZ 0 |
20 | # unset aPointCoords |
21 | list aPointCoords |
22 | for {set i 0} {$i < $POINTS_NUM} {incr i} { |
23 | set aX [expr $aCoef * $aZ * cos($aZ)] |
24 | set aY [expr $aCoef * $aZ * sin($aZ)] |
25 | set aZ [expr $aZ + $STEP] |
26 | lappend aPointCoords $aX |
27 | lappend aPointCoords $aY |
28 | lappend aPointCoords $aZ |
29 | } |
30 | |
31 | vinit |
32 | set aMemInit [meminfo h] |
33 | puts "Initial mem: [expr $aMemInit / (1024 * 1024)] MiB ([expr $aMemInit])" |
34 | polyline p {*}$aPointCoords |
35 | vdisplay p |
36 | |
37 | vfit |
38 | |
39 | puts "Selection time before the transformations:" |
40 | chrono aTimer reset |
41 | chrono aTimer start |
42 | vmoveto 223 236 |
43 | chrono aTimer stop |
44 | chrono aTimer show |
45 | vmoveto 0 0 |
46 | chrono aTimer reset |
47 | chrono aTimer start |
48 | vmoveto 223 236 |
49 | chrono aTimer stop |
50 | chrono aTimer show |
51 | |
52 | puts "" |
53 | puts "Applying transformations..." |
54 | vtranslateview 1 0 0 |
55 | vrotate 100 100 100 |
56 | |
57 | puts "" |
58 | puts "Selection time after the transformations:" |
59 | chrono aTimer reset |
60 | chrono aTimer start |
61 | vmoveto 115 160 |
62 | chrono aTimer stop |
63 | chrono aTimer show |
64 | vmoveto 0 0 |
65 | chrono aTimer reset |
66 | chrono aTimer start |
67 | vmoveto 115 160 |
68 | chrono aTimer stop |
69 | chrono aTimer show |
70 | |
71 | set aMemSel [meminfo h] |
72 | puts "Selection mem: [expr $aMemSel / (1024 * 1024)] MiB ([expr $aMemSel])" |
73 | |
74 | checkcolor 131 195 0 1 1 |