Mesh lights in reasonable condition now.

This commit is contained in:
jmsgrogan 2017-10-25 11:28:46 +01:00
parent aac2496319
commit 911ea182b2
11 changed files with 11 additions and 6 deletions

View file

@ -59,7 +59,8 @@ def generate_pendant_shade(shape_parameters):
rad = shape_parameters["fixture_radius"] rad = shape_parameters["fixture_radius"]
else: else:
rad = morph_shape(abs(vert.co.z)-shape_parameters["stem_length"], rad = morph_shape(abs(vert.co.z)-shape_parameters["stem_length"],
depth, radius-shape_parameters["fixture_radius"], depth-shape_parameters["stem_length"],
radius-shape_parameters["fixture_radius"],
morph_type=shape_parameters["division_pattern"]) morph_type=shape_parameters["division_pattern"])
rad += shape_parameters["fixture_radius"] rad += shape_parameters["fixture_radius"]
vert.co.x = rad*math.sin(theta) vert.co.x = rad*math.sin(theta)
@ -94,12 +95,13 @@ def generate_mesh_shade(shape_parameters):
cube.name = "shade" cube.name = "shade"
bpy.ops.object.mode_set(mode='EDIT') bpy.ops.object.mode_set(mode='EDIT')
num_subdivisions = 3 num_subdivisions = 4
for idx in range(num_subdivisions): for idx in range(num_subdivisions):
bpy.ops.mesh.subdivide() bpy.ops.mesh.subdivide()
bm = bmesh.from_edit_mesh(cube.data) bm = bmesh.from_edit_mesh(cube.data)
slat_thickness = 0.05 slat_thickness = 0.06
max_rad = 0.0
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]
@ -113,11 +115,14 @@ def generate_mesh_shade(shape_parameters):
rad = shape_parameters["fixture_radius"] rad = shape_parameters["fixture_radius"]
else: else:
rad = morph_shape(abs(vert.co.z)-shape_parameters["stem_length"], rad = morph_shape(abs(vert.co.z)-shape_parameters["stem_length"],
depth, depth-shape_parameters["stem_length"],
radius1-shape_parameters["fixture_radius"], radius1-shape_parameters["fixture_radius"],
morph_type=shape_parameters["division_pattern"]) morph_type=shape_parameters["division_pattern"])
rad += shape_parameters["fixture_radius"] rad += shape_parameters["fixture_radius"]
print(radius1, rad, shape_parameters["fixture_radius"])
vert.co.x += rad vert.co.x += rad
if vert.co.x>max_rad:
max_rad = vert.co.x
bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.mode_set(mode='OBJECT')
@ -133,7 +138,7 @@ def generate_mesh_shade(shape_parameters):
# Add torus # Add torus
bpy.ops.mesh.primitive_torus_add(location=(0.0, 0.0, -depth), bpy.ops.mesh.primitive_torus_add(location=(0.0, 0.0, -depth),
major_radius=radius1, major_radius=max_rad,
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 @@
{"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} {"shape": "mesh", "radius": 2.436703407562188, "division_param1": 1.0, "fixture_radius": 0.3, "output": "test789", "division_pattern": "sinusoid", "height": 1.9801308149425492, "style": "billard", "division_param2": 1.0, "fixture_length": 0.3, "stem_length": 0.5}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB