Fix other shade type generation.

This commit is contained in:
jmsgrogan 2017-10-25 09:51:33 +01:00
parent 7c154c2ef6
commit c4e4b090b6
6 changed files with 11 additions and 3 deletions

View file

@ -141,7 +141,11 @@ def generate_cone_shade(radius1, radius2, depth):
bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.mode_set(mode='OBJECT')
return cone return cone
def generate_mesh_shade(radius1, radius2, depth): def generate_mesh_shade(shape_parameters):
radius1 = shape_parameters["radius"]
depth = shape_parameters["height"]
radius2 = shape_parameters["fixture_radius"]
bpy.ops.mesh.primitive_cube_add(radius=radius1) bpy.ops.mesh.primitive_cube_add(radius=radius1)
cube = bpy.data.objects["Cube"] cube = bpy.data.objects["Cube"]
@ -218,7 +222,11 @@ def make_square_ring(radius, depth, thickness):
bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.mode_set(mode='OBJECT')
return bpy.data.objects["square_ring"] return bpy.data.objects["square_ring"]
def generate_led_shade(radius1, radius2, depth): def generate_led_shade(shape_parameters):
radius1 = shape_parameters["radius"]
depth = shape_parameters["height"]
radius2 = shape_parameters["fixture_radius"]
ring1 = make_square_ring(3.0*radius1, depth/10.0, 0.2) 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)) bpy.ops.transform.rotate(value=-math.pi/12.0, axis=(1.0,0.0,0.0))

Binary file not shown.

Binary file not shown.

View file

@ -1 +1 @@
{"style": "light", "division_radii": [0.16451120949404027, 0.23096033701138935, 0.305533414672969, 0.7390854533319504], "height": 3.3522235508986156, "output": "test456", "division_offsets": [0.25, 0.25, 0.25, 0.25], "radius": 2.917962292483968, "shape": "cone", "division_patterns": ["square", "inv_ramp", "inv_square", "ramp"], "fixture_radius": 0.3} {"fixture_radius": 0.3, "output": "test456", "radius": 1.8287633826475211, "height": 3.910662786988026, "division_patterns": ["ramp", "sine", "sine", "inv_sine"], "division_radii": [0.4473225094039008, 0.5963619022128677, 0.7765883654637191, 0.889395569488088], "division_offsets": [0.25, 0.25, 0.25, 0.25], "style": "billard", "shape": "bio"}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 120 KiB