Working on mesh light.

This commit is contained in:
jmsgrogan 2017-10-25 11:14:54 +01:00
parent 6a97bd6cf7
commit aac2496319
6 changed files with 16 additions and 11 deletions

View file

@ -103,15 +103,20 @@ def generate_mesh_shade(shape_parameters):
for i in range( len( bm.verts ) ): for i in range( len( bm.verts ) ):
bm.verts.ensure_lookup_table() bm.verts.ensure_lookup_table()
vert = bm.verts[i] vert = bm.verts[i]
vert.co.z = vert.co.z -radius1/2.0
vert.co.z *= (depth/radius)
vert.co.y = vert.co.y*(slat_thickness/radius)
vert.co.x = vert.co.x*(slat_thickness/radius)
rad = morph_shape(abs(vert.co.z), vert.co.z = vert.co.z - radius1
depth, vert.co.z *= depth/(2.0*radius1)
radius1, vert.co.y = vert.co.y*(slat_thickness/(2.0*radius1))
morph_type=shape_parameters["division_pattern"]) vert.co.x = vert.co.x*(slat_thickness/(2.0*radius1))
if abs(vert.co.z)<shape_parameters["stem_length"]:
rad = shape_parameters["fixture_radius"]
else:
rad = morph_shape(abs(vert.co.z)-shape_parameters["stem_length"],
depth,
radius1-shape_parameters["fixture_radius"],
morph_type=shape_parameters["division_pattern"])
rad += shape_parameters["fixture_radius"]
vert.co.x += rad vert.co.x += rad
bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.mode_set(mode='OBJECT')
@ -127,8 +132,8 @@ def generate_mesh_shade(shape_parameters):
scene.update() scene.update()
# Add torus # Add torus
bpy.ops.mesh.primitive_torus_add(location=(0.0, 0.0, -2.6*radius1), bpy.ops.mesh.primitive_torus_add(location=(0.0, 0.0, -depth),
major_radius=2.4*radius1, major_radius=radius1,
minor_radius=0.02) minor_radius=0.02)
for ob in bpy.context.scene.objects: for ob in bpy.context.scene.objects:

Binary file not shown.

Binary file not shown.

View file

@ -1 +1 @@
{"stem_length": 0.5, "shape": "cone", "height": 3.4934284030014817, "output": "test789", "fixture_radius": 0.3, "fixture_length": 0.3, "division_pattern": "sinusoid", "division_param1": 1.0, "style": "dark", "division_param2": 1.0, "radius": 4.155310289141864} {"shape": "mesh", "division_param2": 1.0, "division_pattern": "logistic", "radius": 4.2770602359636, "output": "test789", "division_param1": 1.0, "style": "billard", "fixture_radius": 0.3, "height": 0.7970418353862341, "fixture_length": 0.3, "stem_length": 0.5}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 127 KiB