2 puts "Capping plane perserving material"
5 set aHatch [locate_data_file images/hatch_1.png]
7 pload MODELING VISUALIZATION
9 puts "Create the geometry"
10 box b0sole 10 10 0 30 30 70
11 box b0hole 20 20 -10 10 10 90
13 box b1 40 20 0 10 30 70
14 box b2 20 40 0 20 10 70
15 box b3 0 40 0 20 10 70
16 box b4 0 10 0 10 30 70
20 set aColors { RED YELLOW GREEN GRAY MAGENTA1 ORANGE }
22 compound b0 b1 b2 b3 b4 b5 cc
24 puts "Create the viewer"
27 vinit name=View1 w=512 h=512
32 puts "Display the geometry as dedicated objects"
33 for { set aPartIter 0 } { $aPartIter < $aNbParts } { incr aPartIter } {
34 vdisplay -noupdate -dispMode 1 b${aPartIter}
35 set aColor [lindex $aColors $aPartIter]
36 vsetcolor -noupdate b${aPartIter} $aColor
39 puts "Display the geometry as sole object"
40 vdisplay -noupdate -dispMode 1 cc
41 for { set aPartIter 0 } { $aPartIter < $aNbParts } { incr aPartIter } {
42 set aColor [lindex $aColors $aPartIter]
43 vaspects -noupdate cc -subShapes b${aPartIter} -setColor $aColor
45 # show also connected interactive object
46 vconnectto co -70 0 0 cc
48 vsetlocation cc 70 0 0
59 vsetlocation -noupdate pp1 25 0 [expr $aPln1Z - 1]
60 vremove -noupdate p1 p2 p3
66 vsetlocation -noupdate pp2 25 $aPln2Y 35
67 vremove -noupdate p1 p2 p3
73 puts "Enable capping planes"
74 vclipplane pln1 -set -equation 0 0 -1 $aPln1Z -capping 1 -color 0.5 0.5 0.5 -texname $aHatch -texscale 0.02 -0.02 -useObjMaterial 1
75 vclipplane pln2 -set -equation 0 1 0 [expr -$aPln2Y] -capping 1 -color 0.8 0.8 0.9 -texname $aHatch -texscale 0.02 -0.02