21.12.2022 Views

python_para_desenvolvedores_2ed

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

294 Blender

prim = Blender.Mesh.Primitives.Cylinder

# Topo

local = x, y, 2.5 + z

tam = .25, .25, .1

objeto(local, tam, mat)

# Base

local = x, y, 0. + z

objeto(local, tam, mat)

# Corpo

for k in xrange(10):

local = x, y, .25 * k + z

tam = .2 - k / 200., .2 - k / 200., .25

objeto(local, tam, mat, prim)

# Cria colunas no fundo

for i in xrange(16):

# Primeira fileira

coluna(i - 8., 8)

# Segunda fileira

coluna(-8., i - 8.)

# Aqueduto

local = -8., i - 8., 3.

tam = .5, .5, .5

objeto(local, tam, mat)

local = i - 8., 8., 3.

objeto(local, tam, mat)

z = .25

# Cria colunas em cima do piso

for i in (-3, 3):

for j in range(-2, 3):

# Fileiras X

coluna(i, j, z)

# Fileiras Y

coluna(j, i, z)

# Cantos

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!