Skip to content

Instantly share code, notes, and snippets.

@kazkansouh
Created May 28, 2018 08:30
Show Gist options
  • Save kazkansouh/6bdd388bc670419bf9aac068a27c3ef3 to your computer and use it in GitHub Desktop.
Save kazkansouh/6bdd388bc670419bf9aac068a27c3ef3 to your computer and use it in GitHub Desktop.
Python function for Blender to automate the process of repeated extruding, rotation and scaling of a given face.
def extrude(step = 5, start = 0, end = 360, minimum_width = 0.5, hstep = 1, rotation = 2) :
"""Extrude, rotate and scale at same time. Before calling, select the
face that this should be applied in the 3d view.
"""
K = (sin(radians(start)) + 1 + minimum_width)
for x in range(start + step, end, step) :
bpy.ops.mesh.extrude_region_move(TRANSFORM_OT_translate={"value":(0,0,hstep)})
bpy.ops.transform.rotate(value=radians(rotation), axis=(0, 0, 1))
L = (sin(radians(x)) + 1 + minimum_width)
M = L / K
K = L
bpy.ops.transform.resize(value=(M,M,0), constraint_axis=(True, True, False))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment