Created
May 28, 2018 08:30
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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