Skip to content

Commit

Permalink
moved file and slow progress to blender engine.
Browse files Browse the repository at this point in the history
  • Loading branch information
joshreve committed Aug 21, 2021
1 parent c9df94e commit 1f6206c
Show file tree
Hide file tree
Showing 2 changed files with 5,805 additions and 5,799 deletions.
14 changes: 10 additions & 4 deletions src/helpers_blender.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ def box(width, height, depth):


def cylinder(radius, height, segments=100):
return sl.cylinder(r=radius, h=height, segments=segments, center=True)
return bpy.ops.mesh.primitive_cylinder_add(
vertices=segments, radius=radius, depth=height, location=(0, 0, 0), rotation=(0, 0, 0)
)



def sphere(radius):
Expand All @@ -31,12 +34,15 @@ def cone(r1, r2, height):


def rotate(shape, angle):
return sl.rotate(angle)(shape)

bpy.ops.transform.rotate(value=-radians(angle[0]), orient_axis='X', center_override=(0.0, 0.0, 0.0))
bpy.ops.transform.rotate(value=-radians(angle[1]), orient_axis='Y', center_override=(0.0, 0.0, 0.0))
bpy.ops.transform.rotate(value=-radians(angle[2]), orient_axis='Z', center_override=(0.0, 0.0, 0.0))
return

def translate(shape, vector):
return bpy.ops.transform.translate(

bpy.ops.transform.translate(value=vector, orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=True, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False)
return

def mirror(shape, plane=None):
debugprint('mirror()')
Expand Down
Loading

0 comments on commit 1f6206c

Please sign in to comment.