HelloWorld3D.py

HelloWorld3D.py#

:HelloWorld3D.py
HelloWorld3D.py

Generate the text primitive

1# Generate the text primitive
2import coat
3name = "Hello world"
4# get to sculpt room
5coat.ui.toRoom("Sculpt")
6# add new volume
7current = coat.Scene.sculptRoot().addChild(name)
8volume = current.Volume()
9# turn to surface
10volume.toSurface()
11# draw the text name with default font name = "Times New Roman",
12# width equals 200 and depth equals 10 and scale 2
13txt = coat.text()
14txt.font(coat.Font())
15txt.string(name)
16txt.width(200)
17txt.depth(10)
18txt.scale(2)
19txt.add(volume)
:HelloWorld3D.py
 1     # Generate the text primitive
 2     import coat
 3     name = "Hello world"
 4     # get to sculpt room
 5     coat.ui.toRoom("Sculpt")
 6     # add new volume
 7     current = coat.Scene.sculptRoot().addChild(name)
 8     volume = current.Volume()
 9     # turn to surface
10     volume.toSurface()
11     # draw the text name with default font name = "Times New Roman",
12     # width equals 200 and depth equals 10 and scale 2
13     txt = coat.text()
14     txt.font(coat.Font())
15     txt.string(name)
16     txt.width(200)
17     txt.depth(10)
18     txt.scale(2)
19     txt.add(volume)