Mesh lights in reasonable condition now.

This commit is contained in:
jmsgrogan 2017-10-25 12:26:10 +01:00
parent 83d88728c5
commit 7925c4b926
13 changed files with 40 additions and 30 deletions

View file

@ -27,7 +27,7 @@ def generate_models(shape_parameters):
location)
# Chord
radius = 0.05
height = 6.0
height = 10.0
location = (0.0, 0.0, height/2.0)
chord = product_gen.generate_lamp_base.generate_chord(height,
radius,

View file

@ -117,7 +117,7 @@ def generate_mesh_shade(shape_parameters):
if abs(vert.co.z)<shape_parameters["stem_length"]:
rad = shape_parameters["fixture_radius"]
else:
rad = morph_shape(1.8*(abs(vert.co.z)-shape_parameters["stem_length"]),
rad = morph_shape(1.0*(abs(vert.co.z)-shape_parameters["stem_length"]),
depth-shape_parameters["stem_length"],
radius1-shape_parameters["fixture_radius"],
morph_type=shape_parameters["division_pattern"])

View file

@ -12,6 +12,7 @@ def setup_renderer(shape_parameters, engine="CYCLES"):
this_scene.cycles.caustics_refractive = False
this_scene.cycles.max_bounces = 0.0
this_scene.render.use_border = False
this_scene.render.use_simplify = True
this_scene.render.border_max_y = 0.75
this_scene.render.border_min_y = 0.33
this_scene.render.border_min_x = 0.25

View file

@ -11,9 +11,12 @@ def initialize_scene(shape_parameters):
def setup_scene(shape_parameters):
# Set up world
use_backwall = False
if not use_backwall:
bpy.context.scene.world.use_sky_paper = True
bpy.context.scene.world.horizon_color = (0.99, 0.8, 0.8)
bpy.context.scene.world.horizon_color = (1.0, 1.0, 1.0)
#bpy.context.scene.world.light_settings.use_environment_light = True
else:
# Add back wall
bpy.ops.mesh.primitive_plane_add(radius=20, location=(-10.0, 0.0, 0.0))
@ -35,11 +38,17 @@ def setup_scene(shape_parameters):
bpy.context.active_object.data.materials.append(mat)
# Set up cameras
bpy.data.objects["Camera"].location = (8.5, 0.0, -2)
radius = shape_parameters["radius"]
height = shape_parameters["height"]
xloc = 1.5 + (3.0*radius + height)/2.0
zloc = -0.4 - height
bpy.data.objects["Camera"].location = (xloc, 0.0000, zloc)
fov = 65.0
bpy.data.objects["Camera"].data.angle = fov*(math.pi/180.0)
bpy.data.objects["Camera"].rotation_mode = 'XYZ'
bpy.data.objects["Camera"].rotation_euler[0] = 1.5
bpy.data.objects["Camera"].rotation_euler[0] = 1.9326
bpy.data.objects["Camera"].rotation_euler[1] = 0.0
bpy.data.objects["Camera"].rotation_euler[2] = 1.5708

View file

@ -23,12 +23,12 @@ if __name__ == "__main__":
os.makedirs(os.getcwd() + "/" + output)
# Global bounding box
bbox_xmax = 5.0
bbox_ymax = 4.0
bbox_xmax = 3.0
bbox_ymax = 3.0
# Minimum feature sizes
feature_xmin = 2.0
feature_ymin = 0.5
feature_xmin = 1.0
feature_ymin = 1.0
shape_parameters = sd.get_random_shape_description(shape,
[bbox_xmax, bbox_ymax],
[feature_xmin, feature_ymin])

Binary file not shown.

Binary file not shown.

View file

@ -1 +1 @@
{"division_param1": 1.0, "division_param2": 1.0, "stem_length": 0.5, "fixture_length": 0.3, "style": "billard", "radius": 3.687568125159161, "output": "test789", "shape": "mesh", "division_pattern": "circle", "fixture_radius": 0.3, "height": 3.6552215108138246}
{"shape": "cone", "fixture_length": 0.3, "stem_length": 0.5, "style": "billard", "radius": 1.298856337538413, "division_pattern": "logistic", "division_param1": 1.0, "division_param2": 1.0, "output": "test789", "height": 2.2653976569924654, "fixture_radius": 0.3}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 19 KiB