This example generates the surface figure that consists of capsule.
This example generates the surface figure that consists of capsule
1
2import coat
3import pickle
4
5class CapsulePrim:
6 def __init__(self):
7 self.Radius = 30
8 self.Height = 200
9
10
11 def ui(self):
12 return [
13 "Radius,[10,100]",
14 "Height,[20,200]"
15 ]
16 def build(self) :
19 volume = current.Volume()
20 volume.toSurface()
22 capsule.height(self.Height)
23 capsule.radiusTop(self.Radius)
24 capsule.radiusBottom(self.Radius)
25 capsule.details(0.5)
26 capsule.add(volume)
27
28
30capsulePrim = CapsulePrim()
31
32try:
34 capsulePrim = pickle.load(f)
35except Exception:
36 print("Unable to load settings, probably file is missing, maybe this is the first time you run this sample.")
37
38if(
coat.dialog().ok().cancel().params(capsulePrim).show() == 1) :
39
41 pickle.dump(capsulePrim, f)
42
43 capsulePrim.build()
44
SceneElement sculptRoot()
get the root of all sculpt objects
Definition coat.py:2843
str documents(path=str)
convert the relative path to the path in documents, if the path is absolute, just return the original...
Definition coat.py:3611
toRoom(name=str)
switch to the room
Definition coat.py:3251