Meshes and primitives.
1
2import coat
3from coat import vec3
4from coat import Mesh
5
6
8
9root.toSurface()
10
11
12mesh = Mesh.box(size=vec3(10,20,30), yAxis=vec3(0.5,1,0), center=vec3(3,4,5),detail_size=2, fillet=2)
13
14mesh.booleanOp(Mesh.cylinder(radius = 5,height = 30, detail_size = 2),coat.BoolOpType.BOOL_SUBTRACT)
15
16
17mesh += Mesh.text("Rotated box, subtracted cylinder",height = 15, center = vec3(-10,0,0), align = 2)
18
19
20mesh += Mesh.cylinder(center = vec3(0, 0, 50),radius = 10,height = 30, detail_size = 2)
21mesh += Mesh.text("Cylinder",height = 15, center = vec3(-20, 0, 50), align = 2)
22
23
24mesh += Mesh.cone(center = vec3(0, 0, 100), topAxis = vec3.RandNormal(), radius = 10, height = 50, detail_size = 2)
25mesh += Mesh.text("Random cone",height = 15, center = vec3(-30, 0, 100), align = 2)
26
27
28mesh += Mesh.plane(center = vec3(0, 0, 150), sizeX = 20, sizeY = 20, divisionsX = 7, divisionsY = 9, xAxis = vec3.AxisX, yAxis = vec3.AxisZ)
29mesh += Mesh.text("Plane",height = 15, center = vec3(-30, 0, 150), align = 2)
30
31
32mesh += Mesh.sphere(center = vec3(0, 0, 200), radius = 15)
33mesh += Mesh.text("Sphere",height = 15, center = vec3(-30, 0, 200), align = 2)
34
35
36
37
38
39root.mergeMesh(mesh)
SceneElement sculptRoot()
get the root of all sculpt objects
Definition coat.py:2687