Search This Blog

Showing posts with label spiral. Show all posts
Showing posts with label spiral. Show all posts

Monday 20 December 2021

BPY SCRIPT TO DRAW A SPIRAL

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
 
-----------------------------------------------------------------------------------------------------------------------------

 


TO MIRROR ARMATURE BONES ON X AXIS 1. Assume that we are making a human rig in standing position. 2. Set the view to front view. 3. Create t...