0029768: Visualization, TKOpenGl - structure is entirely clipped by suppressed clipping
[occt.git] / tests / bugs / vis / bug27751_capping
CommitLineData
3e05329c 1puts "========"
2puts "Capping plane perserving material"
3puts "========"
4
5set aHatch [locate_data_file images/hatch_1.png]
6
7pload MODELING VISUALIZATION
8
9puts "Create the geometry"
10box b0sole 10 10 0 30 30 70
11box b0hole 20 20 -10 10 10 90
12bcut b0 b0sole b0hole
13box b1 40 20 0 10 30 70
14box b2 20 40 0 20 10 70
15box b3 0 40 0 20 10 70
16box b4 0 10 0 10 30 70
17box b5 0 0 0 30 10 70
18
19set aNbParts 6
20set aColors { RED YELLOW GREEN GRAY MAGENTA1 ORANGE }
21
22compound b0 b1 b2 b3 b4 b5 cc
23
24puts "Create the viewer"
25vclear
26vclose ALL
27vinit name=View1 w=512 h=512
28
29vpoint p0 0 0 0
30vzbufftrihedron
31
32puts "Display the geometry as dedicated objects"
33for { 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
37}
38
39puts "Display the geometry as sole object"
40vdisplay -noupdate -dispMode 1 cc
41for { set aPartIter 0 } { $aPartIter < $aNbParts } { incr aPartIter } {
42 set aColor [lindex $aColors $aPartIter]
43 vaspects -noupdate cc -subShapes b${aPartIter} -setColor $aColor
44}
45# show also connected interactive object
46vconnectto co -70 0 0 cc
47vsetdispmode co 1
48vsetlocation cc 70 0 0
49vfit
50
51
52set aPln1Z 40
53set aPln2Y 15
54
55vremove -noupdate p1 p2 p3 pp1 pp2
56vpoint p1 0 0 1
57vpoint p2 1 0 1
58vpoint p3 0 1 1
59vplane pp1 p1 p2 p3
60vsetlocation -noupdate pp1 25 0 [expr $aPln1Z - 1]
61vremove -noupdate p1 p2 p3
62
63vpoint p1 0 1 0
64vpoint p2 1 1 0
65vpoint p3 0 1 1
66vplane pp2 p1 p2 p3
67vsetlocation -noupdate pp2 25 $aPln2Y 35
68vremove -noupdate p1 p2 p3
69verase pp1 pp2
70vfit
71vdisplay pp1 pp2
72vzoom 0.8
73
74puts "Enable capping planes"
75vclipplane 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
76vclipplane pln2 -set -equation 0 1 0 [expr -$aPln2Y] -capping 1 -color 0.8 0.8 0.9 -texname $aHatch -texscale 0.02 -0.02