diff --git a/src/product_gen/__pycache__/generate_shades.cpython-35.pyc b/src/product_gen/__pycache__/generate_shades.cpython-35.pyc index 980efa8..dd41bf7 100644 Binary files a/src/product_gen/__pycache__/generate_shades.cpython-35.pyc and b/src/product_gen/__pycache__/generate_shades.cpython-35.pyc differ diff --git a/src/product_gen/generate_shades.py b/src/product_gen/generate_shades.py index 91c1712..68c24ce 100644 --- a/src/product_gen/generate_shades.py +++ b/src/product_gen/generate_shades.py @@ -84,33 +84,30 @@ def generate_pendant_shade(shape_parameters): if division_type == "straight": vert.co.x = division_radius*math.sin(theta) vert.co.y = division_radius*math.cos(theta) -# elif division_type == "square": -# mapped_rad = division_radius + (delta/3.0)**2 -# vert.co.x = mapped_rad*math.sin(theta) -# vert.co.y = mapped_rad*math.cos(theta) + elif division_type == "square": + mapped_rad = division_radius + (frac)**2 + vert.co.x = mapped_rad*math.sin(theta) + vert.co.y = mapped_rad*math.cos(theta) # elif division_type == "inv_square": -# mapped_rad = division_radius + 1.0/(0.01+delta**2) +# mapped_rad = division_radius + 1.0/(0.01+frac**2) # vert.co.x = mapped_rad*math.sin(theta) # vert.co.y = mapped_rad*math.cos(theta) - else: -# elif division_type == "sine": - + elif division_type == "sine": mapped_rad = division_radius + math.sin(math.pi/2.0*frac) vert.co.x = mapped_rad*math.sin(theta) vert.co.y = mapped_rad*math.cos(theta) # elif division_type == "inv_sine": -# mapped_rad = division_radius + 1.0/math.sin(delta) -# vert.co.x = mapped_rad*math.sin(theta) -# vert.co.y = mapped_rad*math.cos(theta) -# else: -# #elif division_type == "ramp": -# mapped_rad = division_radius + delta -# vert.co.x = mapped_rad*math.sin(theta) -# vert.co.y = mapped_rad*math.cos(theta) -# elif division_type == "inv_ramp": -# mapped_rad = division_radius + delta +# mapped_rad = division_radius + 1.0/math.sin(math.pi/2.0*frac) # vert.co.x = mapped_rad*math.sin(theta) # vert.co.y = mapped_rad*math.cos(theta) + elif division_type == "ramp": + mapped_rad = division_radius + frac + vert.co.x = mapped_rad*math.sin(theta) + vert.co.y = mapped_rad*math.cos(theta) + elif division_type == "inv_ramp": + mapped_rad = division_radius + frac + vert.co.x = mapped_rad*math.sin(theta) + vert.co.y = mapped_rad*math.cos(theta) for face in bm.faces: if UpOrDown(face.normal): diff --git a/src/shapes/__pycache__/shape_description.cpython-35.pyc b/src/shapes/__pycache__/shape_description.cpython-35.pyc index f3e7ca5..819baa3 100644 Binary files a/src/shapes/__pycache__/shape_description.cpython-35.pyc and b/src/shapes/__pycache__/shape_description.cpython-35.pyc differ diff --git a/src/shapes/shape_description.py b/src/shapes/shape_description.py index 47d5215..86df3dc 100644 --- a/src/shapes/shape_description.py +++ b/src/shapes/shape_description.py @@ -45,7 +45,7 @@ def get_random_shape_description(shape, bbox, feature_min): shape_description = copy.deepcopy(_shape_description) shape_description["shape"] = shape - max_divisions = 3 + max_divisions = 5 num_divisions = int(1 + random.random()*(max_divisions-1)) num_divisions = 4 diff --git a/src/utility/generate_shape.py b/src/utility/generate_shape.py index 7de01d3..463ce38 100644 --- a/src/utility/generate_shape.py +++ b/src/utility/generate_shape.py @@ -7,7 +7,7 @@ import sys import random import json import product_gen.generate_product -import product_gen.shapes.shape_description as sd +import shapes.shape_description as sd from argparse import ArgumentParser if __name__ == "__main__": diff --git a/src/utility/test456/test456.blend b/src/utility/test456/test456.blend index 5f0346c..65eaa82 100644 Binary files a/src/utility/test456/test456.blend and b/src/utility/test456/test456.blend differ diff --git a/src/utility/test456/test456.blend1 b/src/utility/test456/test456.blend1 index 3478fa1..5f0346c 100644 Binary files a/src/utility/test456/test456.blend1 and b/src/utility/test456/test456.blend1 differ diff --git a/src/utility/test456/test456.json b/src/utility/test456/test456.json index 6c2e2d9..fdab12e 100644 --- a/src/utility/test456/test456.json +++ b/src/utility/test456/test456.json @@ -1 +1 @@ -{"radius": 0.2561832220044716, "height": 2.088070401902109, "shape": "cone", "color": [0.1, 0.1, 0.1]} \ No newline at end of file +{"fixture_radius": 0.3, "division_radii": [0.7366486532785445, 0.8362702452541098, 0.9661599163089211, 0.9867733391465805], "radius": 0.611924774203075, "division_patterns": ["inv_square", "inv_ramp", "sine", "inv_square"], "shape": "cone", "height": 3.7486713335143, "style": "light", "division_offsets": [0.25, 0.25, 0.25, 0.25]} \ No newline at end of file diff --git a/src/utility/test456/test456.png b/src/utility/test456/test456.png index 848a2d4..d343779 100644 Binary files a/src/utility/test456/test456.png and b/src/utility/test456/test456.png differ diff --git a/test/test/test.blend b/test/test/test.blend index 9051e27..bac4724 100644 Binary files a/test/test/test.blend and b/test/test/test.blend differ diff --git a/test/test/test.blend1 b/test/test/test.blend1 index 2ed940e..ffcdeac 100644 Binary files a/test/test/test.blend1 and b/test/test/test.blend1 differ diff --git a/test/test/test.json b/test/test/test.json index becab29..e333aee 100644 --- a/test/test/test.json +++ b/test/test/test.json @@ -1 +1 @@ -{"shape": "pendant", "style": "dark", "division_patterns": ["ramp", "ramp", "inv_ramp", "inv_sine"], "fixture_radius": 0.3, "height": 4.305539689400392, "radius": 0.8584699492695225, "division_offsets": [0.25, 0.25, 0.25, 0.25], "division_radii": [0.5441324228652892, 0.6530641783849034, 0.7409502304795115, 0.751148488921151]} \ No newline at end of file +{"division_offsets": [0.25, 0.25, 0.25, 0.25], "radius": 1.0601818200308606, "shape": "pendant", "height": 4.455460011829081, "style": "billard", "division_patterns": ["sine", "square", "sine", "inv_ramp"], "fixture_radius": 0.3, "division_radii": [0.5868447602079319, 0.596539544538136, 0.7007834420344027, 0.87385109148988]} \ No newline at end of file diff --git a/test/test/test.png b/test/test/test.png index 56ab597..e12129c 100644 Binary files a/test/test/test.png and b/test/test/test.png differ