The script will draw a spiral using the cube object which is repeatedly positioned along a spiral path. The spiral is visible in the Top ortho view(7).
-----------------------------------------------------------------------------------------------------------------------------
import bpy
from math import sin,cos,pi
bigdeg=pi*2
smalldeg=pi/100
radius=2
for i in range(0,500):
x=radius*sin(smalldeg*i)
y=radius*cos(smalldeg*i)
z=0
bpy.ops.mesh.primitive_cube_add(location=(x,y,z))
bpy.ops.transform.resize(value=(1,1,1))
mat_red=bpy.data.materials.new("red")
mat_red.diffuse_color=(0.8, 0, 0)
mesh=bpy.context.object.data
mesh.materials.clear()
mesh.materials.append(mat_red)
radius +=.07
-----------------------------------------------------------------------------------------------------------------------------
No comments:
Post a Comment