Working on mesh light.
This commit is contained in:
parent
6a97bd6cf7
commit
aac2496319
6 changed files with 16 additions and 11 deletions
Binary file not shown.
|
@ -103,15 +103,20 @@ def generate_mesh_shade(shape_parameters):
|
|||
for i in range( len( bm.verts ) ):
|
||||
bm.verts.ensure_lookup_table()
|
||||
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),
|
||||
depth,
|
||||
radius1,
|
||||
morph_type=shape_parameters["division_pattern"])
|
||||
vert.co.z = vert.co.z - radius1
|
||||
vert.co.z *= depth/(2.0*radius1)
|
||||
vert.co.y = vert.co.y*(slat_thickness/(2.0*radius1))
|
||||
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
|
||||
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
|
@ -127,8 +132,8 @@ def generate_mesh_shade(shape_parameters):
|
|||
scene.update()
|
||||
|
||||
# Add torus
|
||||
bpy.ops.mesh.primitive_torus_add(location=(0.0, 0.0, -2.6*radius1),
|
||||
major_radius=2.4*radius1,
|
||||
bpy.ops.mesh.primitive_torus_add(location=(0.0, 0.0, -depth),
|
||||
major_radius=radius1,
|
||||
minor_radius=0.02)
|
||||
|
||||
for ob in bpy.context.scene.objects:
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -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 |
Loading…
Reference in a new issue