92ad26cbea2f9f539cd8f1a69ae177d7ac9d4197
[occt.git] / samples / tcl / pencil.tcl
1 # Sample demonstrating assignment of colors to faces in XDE
2
3 #Category: XDE
4 #Title: Assignment of colors to faces
5
6 pload MODELING VISUALIZATION OCAF XDE
7
8 box b 0 -20 -10 100 40 20
9 compound b b b a
10 explode a
11 trotate a_1 0 0 0 1 0 0 60
12 trotate a_2 0 0 0 1 0 0 -60
13 bcommon b a a_1
14 bcommon b b a_2
15
16 pcylinder c 4 100
17 trotate c 0 0 0 0 1 0 90
18
19 psphere s 1.4
20 ttranslate s 99.2 0 0
21 bfuse cx c s
22
23 pcone e 60 0.5 101
24 trotate e 0 0 0 0 1 0 90
25
26 bcommon body b e
27 bcut body body c
28 bcommon core cx e
29
30 text2brep text "CAD Assistant" -font Times -height 10
31 ttranslate text 10 -4 10
32 prism tr text 0 0 -1
33 bfuse body body tr
34
35 donly body core
36
37 #vdisplay body core
38 #vsetcolor body yellow
39 #vsetcolor core red
40
41 explode body so
42 explode body_1 f
43 explode core so
44
45 NewDocument D
46 XAddShape D body_1
47 XAddShape D core_1
48
49 for {set i 1} {$i <= 26} {incr i} {XSetColor D body_1_$i BLUE}
50 XSetColor D body_1_1 E68066
51 XSetColor D body_1_9 E68066
52 for {set i 10} {$i <= 22} {incr i} {XSetColor D body_1_$i 99B300}
53 XSetColor D core_1 1A1AFF
54 foreach ff [explode core_1 f] { XSetColor D $ff 1A1AFF ; puts "set color $ff" }
55
56 vclear
57 vinit View1
58 XDisplay -dispMode 1 D -explore
59 vfit
60 vrenderparams -msaa 8
61 vbackground -color WHITE
62
63 #param write.iges.brep.mode 1
64 #WriteIges D d:/pencil3.igs