1 # Script displays properties of different materials available in OCCT
3 set THE_MATERIALS {brass bronze copper gold jade neon_phc pewter obsidian plaster plastic satin silver steel stone chrome aluminium water glass diamond charcoal}
4 set THE_COLORS {default red green blue1}
13 foreach aMatIter $::THE_MATERIALS {
14 vdrawtext "$aMatIter" $x $y 0 $r $g $b 2 1 000 0 14 1 Arial
19 foreach aColIter $::THE_COLORS {
20 if { $aColIter == "red" } {
24 } elseif { $aColIter == "green" } {
28 } elseif { $aColIter == "blue1" } {
33 vdrawtext "$aColIter" $x $y 0 $r $g $b 1 1 000 0 14 1 Arial
34 incr x $::THE_ROW_DIST
38 proc drawObjects {theRow theColor} {
42 set x [expr 30 + $theRow * $::THE_ROW_DIST]
44 foreach aMatIter $::THE_MATERIALS {
45 set aSph s${theRow}_${aCounter}
46 set aBox b${theRow}_${aCounter}
47 uplevel #0 psphere $aSph $aSize
48 uplevel #0 box $aBox $aCtr $aCtr $aCtr $aSize $aSize $aSize
49 uplevel #0 ttranslate $aSph $x $y 0
50 uplevel #0 ttranslate $aBox [expr $x + 10] $y 0
51 uplevel #0 vdisplay -noredraw $aSph $aBox
52 uplevel #0 vsetmaterial -noredraw $aSph $aBox $aMatIter
53 if {$theColor != ""} {
54 uplevel #0 vsetcolor -noredraw $aSph $aBox $theColor
61 # setup 3D viewer content
62 pload MODELING VISUALIZATION
64 catch { vclose View1 }
65 vinit View1 w=768 h=768
69 vsetgradientbg 180 200 255 180 180 180 2
70 vlight change 0 pos -1 1 1
73 # adjust scene bounding box
74 box bnd 0 0 0 180 210 1
75 vdisplay -noredraw bnd
80 # draw spheres and boxes with different materials