demoSphereBorg.py
Main Page
Modules
Classes
Examples
demoSphereBorg.py
1
'''
2
Demonstrates creating objects, object instancing, and object translation.
3
'''
4
5
import
MaxPlus
6
7
def
CreateBorg(obj, n, sz):
8
for
i
in
xrange(n):
9
for
j
in
xrange(n):
10
for
k
in
xrange(n):
11
name =
"element_{0}_{1}_{2}"
.format(i, j, k)
12
node =
MaxPlus.Factory.CreateNode
(obj, name)
13
pt =
MaxPlus.Point3
(i * sz, j * sz, k * sz)
14
node.Move(pt)
15
16
def
main():
17
obj =
MaxPlus.Factory.CreateGeomObject
(MaxPlus.ClassIds.Sphere)
18
obj.ParameterBlock.Radius.Value = 2.0
19
CreateBorg(obj, 4, 5.0)
20
21
if
__name__ ==
"__main__"
:
22
main()
23
24
25
26
27
28
29
30
31