3DCoat Python API
The 3DCoat Python API documentation.
Loading...
Searching...
No Matches
capsule.py

This example generates the surface figure that consists of capsule.

This example generates the surface figure that consists of capsule

1# This example generates the surface figure that consists of capsule
2import coat
3
4class CapsulePrim:
5 def __init__(self):
6 self.Radius = 30
7 self.Height = 200
8
9 # this is class registration, look dialogs example
10 def ui(self):
11 return [
12 "Radius,[10,100]",
13 "Height,[20,200]"
14 ]
15 def build(self) :
16 voxId = coat.Scene.sculptRoot().childCount()
17 current = coat.Scene.sculptRoot().addChild("Capsule" + str(voxId))
18 volume = current.Volume()
19 volume.toSurface()
20 capsule = coat.capsule()
21 capsule.height(self.Height)
22 capsule.radiusTop(self.Radius)
23 capsule.radiusBottom(self.Radius)
24 capsule.details(0.5)
25 capsule.add(volume)
26
27# get to sculpt room
28coat.ui.toRoom("Sculpt")
29capsulePrim = CapsulePrim()
30# show the dialog
31if(coat.dialog().ok().cancel().params(capsulePrim).show() == 1) :# ok pressed, buttons start from 1
32 # build the figure
33 capsulePrim.build()
34
SceneElement sculptRoot()
get the root of all sculpt objects
Definition coat.py:2687
Definition coat.py:5224
Definition coat.py:3450
toRoom(str name, bool Force=False)
switch to the room
Definition coat.py:3284