0025687: Visualization, XCAF - eliminate visual artifacts at the edges of faces
[occt.git] / tests / bugs / vis / bug25532
CommitLineData
c8be748c 1puts "============"
2puts "OCC25532"
3puts "============"
4puts ""
5#######################################################################
6# Visualization - fix cross-references between AIS_ConnectedInteractive
7# and connected presentation
8#######################################################################
9
10pload MODELING VISUALIZATION
11psphere s 0.5
12tclean s
13incmesh s 0.001
14trinfo s
15
16vinit View1
17vclear
18vaxo
19vcaps -vbo 0
20vsetdispmode 1
21vdefaults absDefl=1.0
22set aMemInit [meminfo h]
23
24set aNb 1000
25
26# display as copies
27eval compound [lrepeat $aNb s] ss
28explode ss
29for {set i 1} {$i <= $aNb} {incr i} { vdisplay -noupdate ss_${i}; vsetlocation -noupdate ss_${i} 0 0 s }
30vfit
31set aMemDisp1 [meminfo h]
32vclear
33set aMemClear1 [meminfo h]
34
35# display as connected instances of single presentation
36vconnectto i_1 0 0 0 s
37for {set i 2} {$i < $aNb} {incr i} { vconnectto i_${i} ${i} 0 0 i_1 }
38set aMemDisp2 [meminfo h]
39vclear
40set aMemClear2 [meminfo h]
41
42puts "Initial memory: [expr $aMemInit / (1024 * 1024)] MiB"
43puts "Displaying (simple): [expr $aMemDisp1 / (1024 * 1024)] MiB"
44puts "Clearing (simple): [expr $aMemClear1 / (1024 * 1024)] MiB"
45puts "Displaying (connected): [expr $aMemDisp2 / (1024 * 1024)] MiB"
46puts "Clearing (connected): [expr $aMemClear2 / (1024 * 1024)] MiB"
47
48set aRatio [expr $aMemClear2 / double($aMemClear1)]
49
50# check if the memory difference is greater than 10%
51if [expr $aRatio > 1.1] {
52 puts "Error : TEST FAILED"
53}
54