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