0025024: BSplCLib::PrepareInsertKnots reports incorrect number of poles
[occt.git] / samples / tcl / xde.tcl
CommitLineData
a347ef35 1# Simple sample demonstrating work with assemblies in XDE, and assignment of
2# names and colors to components vs. instances
3
4pload MODELING
5pload OCAF
6pload XDE
7
8puts "Make a link as assembly made of a pin and two instances of the same nut"
9pcylinder pin 1 10
10pcylinder nut 2 2
11compound nut nut nuts
12explode nuts
13ttranslate nuts_1 0 0 7
14ttranslate nuts_2 0 0 1
15compound pin nuts_1 nuts_2 link
16
17puts "Add link assembly in XCAF document, and add names and colors:"
18NewDocument D XCAF
19XAddShape D link
20SetName D [XFindShape D pin] "Pin"
21SetName D [XFindShape D nut] "Nut"
22SetName D [XFindShape D link] "Link"
23SetName D [XFindShape D link]:1 "Pin instance"
24SetName D [XFindShape D link]:2 "Nut instance 1"
25SetName D [XFindShape D link]:3 "Nut instance 2"
26
27puts "- Pin will be white"
28XSetColor D [XFindShape D pin] 1 1 1
29puts "- Nut itself will be dark gray"
30XSetColor D [XFindShape D nut] 0.1 0.1 0.1
31puts "- Nut instance #1 will be red"
32XSetColor D [XFindShape D link]:2 1 0 0
33puts "- Nut instance #2 will be green"
34XSetColor D [XFindShape D link]:3 0 1 0
35
36puts "Starting DF browser..."
37DFBrowse D
38puts "Expand the document tree to see its structure and assigned names"
39
40puts "Showing assembly in 3d view..."
41XShow D
42vfit
43vsetdispmode 1