Add bio type light.
This commit is contained in:
parent
29f788385d
commit
b74feeb77c
11 changed files with 72 additions and 56 deletions
|
@ -131,36 +131,14 @@ def generate_mesh_shade(radius1, radius2, depth):
|
|||
ob.select = False
|
||||
bpy.ops.object.join()
|
||||
|
||||
# mapped_rad = radius2 + delta**2
|
||||
# vert.co.x = mapped_rad*math.sin(theta)
|
||||
# vert.co.y = mapped_rad*math.cos(theta)
|
||||
#
|
||||
# for face in bm.faces:
|
||||
# if UpOrDown(face.normal):
|
||||
# face.select = True
|
||||
# else:
|
||||
# face.select = False
|
||||
# faces_select = [f for f in bm.faces if f.select]
|
||||
# bmesh.ops.delete(bm, geom=faces_select, context=3)
|
||||
# bmesh.update_edit_mesh(cone.data, True)
|
||||
#
|
||||
# # Extrude faces
|
||||
# bpy.ops.mesh.select_mode( type = 'FACE' )
|
||||
# bpy.ops.mesh.select_all( action = 'SELECT' )
|
||||
# bpy.ops.mesh.extrude_region_move(
|
||||
# TRANSFORM_OT_translate={"value":(0, 0, 0.01)} )
|
||||
# bpy.ops.mesh.extrude_region_shrink_fatten(
|
||||
# TRANSFORM_OT_shrink_fatten={"value":-0.05})
|
||||
|
||||
return cube
|
||||
|
||||
def generate_bio_shade(radius1, radius2, depth):
|
||||
|
||||
bpy.ops.mesh.primitive_cone_add(radius1=radius1,
|
||||
radius2=radius2,
|
||||
depth=depth)
|
||||
cone = bpy.data.objects["Cone"]
|
||||
cone.name = "shade"
|
||||
def make_square_ring(radius, depth, thickness):
|
||||
|
||||
bpy.ops.mesh.primitive_cylinder_add(radius=radius,
|
||||
depth=depth)
|
||||
cone = bpy.data.objects["Cylinder"]
|
||||
cone.name = "square_ring"
|
||||
bpy.ops.object.mode_set(mode='EDIT')
|
||||
bm = bmesh.from_edit_mesh(cone.data)
|
||||
for face in bm.faces:
|
||||
|
@ -178,8 +156,41 @@ def generate_bio_shade(radius1, radius2, depth):
|
|||
bpy.ops.mesh.extrude_region_move(
|
||||
TRANSFORM_OT_translate={"value":(0, 0, 0.01)} )
|
||||
bpy.ops.mesh.extrude_region_shrink_fatten(
|
||||
TRANSFORM_OT_shrink_fatten={"value":-0.05})
|
||||
TRANSFORM_OT_shrink_fatten={"value":-thickness})
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
return cone
|
||||
return bpy.data.objects["square_ring"]
|
||||
|
||||
def generate_bio_shade(radius1, radius2, depth):
|
||||
|
||||
ring1 = make_square_ring(3.0*radius1, depth/10.0, 0.2)
|
||||
bpy.ops.transform.rotate(value=-math.pi/12.0, axis=(1.0,0.0,0.0))
|
||||
|
||||
ring2 = make_square_ring(1.5*radius1, depth/10.0, 0.2)
|
||||
bpy.ops.transform.rotate(value=math.pi/12.0, axis=(1.0,0.0,0.0))
|
||||
|
||||
ring3 = make_square_ring(1.0*radius1, depth/10.0, 0.2)
|
||||
bpy.ops.transform.rotate(value=-math.pi/8.0, axis=(1.0,0.0,0.0))
|
||||
|
||||
for ob in bpy.context.scene.objects:
|
||||
if ob.type == 'MESH':
|
||||
ob.select = True
|
||||
bpy.context.scene.objects.active = ob
|
||||
else:
|
||||
ob.select = False
|
||||
bpy.ops.object.join()
|
||||
|
||||
bpy.context.scene.objects.active = bpy.data.objects["square_ring"]
|
||||
bpy.data.objects["square_ring"].name = "shade"
|
||||
|
||||
ring1 = make_square_ring(3.0*radius1+0.01, depth/16.0, 0.2)
|
||||
bpy.ops.transform.rotate(value=-math.pi/12.0, axis=(1.0,0.0,0.0))
|
||||
|
||||
ring2 = make_square_ring(1.5*radius1+0.01, depth/16.0, 0.2)
|
||||
bpy.ops.transform.rotate(value=math.pi/12.0, axis=(1.0,0.0,0.0))
|
||||
|
||||
ring3 = make_square_ring(1.1*radius1+0.01, depth/16.0, 0.2)
|
||||
bpy.ops.transform.rotate(value=-math.pi/8.0, axis=(1.0,0.0,0.0))
|
||||
|
||||
return bpy.data.objects["shade"]
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue