diff --git a/.gitignore b/.gitignore index 72db22d..f949983 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ __pycache__/ backup/ .vscode/ -render/ \ No newline at end of file +render/ +galleries/ \ No newline at end of file diff --git a/otls/brickini.brickini_imperfections.1.3.hdalc b/otls/brickini.brickini_imperfections.1.4.hdalc similarity index 67% rename from otls/brickini.brickini_imperfections.1.3.hdalc rename to otls/brickini.brickini_imperfections.1.4.hdalc index 7b9583e..694116c 100644 Binary files a/otls/brickini.brickini_imperfections.1.3.hdalc and b/otls/brickini.brickini_imperfections.1.4.hdalc differ diff --git a/otls/brickini.brickini_ldraw_part.1.15.hdalc b/otls/brickini.brickini_ldraw_part.1.15.hdalc deleted file mode 100644 index e52b314..0000000 Binary files a/otls/brickini.brickini_ldraw_part.1.15.hdalc and /dev/null differ diff --git a/otls/brickini.brickini_ldraw_part.1.16.hdalc b/otls/brickini.brickini_ldraw_part.1.16.hdalc new file mode 100644 index 0000000..2babd67 Binary files /dev/null and b/otls/brickini.brickini_ldraw_part.1.16.hdalc differ diff --git a/otls/brickini.brickini_material.1.2.hdalc b/otls/brickini.brickini_material.1.2.hdalc index 3cb728f..3e57300 100644 Binary files a/otls/brickini.brickini_material.1.2.hdalc and b/otls/brickini.brickini_material.1.2.hdalc differ diff --git a/python3.9libs/convert_ldconfig_to_json.py b/python3.9libs/convert_ldconfig_to_json.py index 8bff409..a81f58f 100644 --- a/python3.9libs/convert_ldconfig_to_json.py +++ b/python3.9libs/convert_ldconfig_to_json.py @@ -2,7 +2,6 @@ import re import json - resources = Path(__file__).resolve().parent.parent / 'resources' / 'ld_colors.json' ldconfig = '/home/stefan/ldraw/LDConfig.ldr' @@ -12,13 +11,13 @@ def hex_to_rgb(hex_value): decimal_g = int(hex_value[2:4], 16) decimal_b = int(hex_value[4:6], 16) - # Convert decimal RGB to linear sRGB - linear_r = (decimal_r / 255) ** 2.2 - linear_g = (decimal_g / 255) ** 2.2 - linear_b = (decimal_b / 255) ** 2.2 + # Convert decimal RGB to float + r = (decimal_r / 255) ** 2.2 + g = (decimal_g / 255) ** 2.2 + b = (decimal_b / 255) ** 2.2 # Return as list - return [linear_r, linear_g, linear_b] + return [r, g, b] color_dict = {} @@ -48,7 +47,6 @@ def hex_to_rgb(hex_value): 'rgb': rgb } - with open(resources, 'w') as f: json.dump(color_dict, f, indent=4) diff --git a/python3.9libs/ldraw.py b/python3.9libs/ldraw.py index 66c578f..818d006 100644 --- a/python3.9libs/ldraw.py +++ b/python3.9libs/ldraw.py @@ -126,12 +126,12 @@ def place_part(color_code, part, geo_node): def transform_part(node, m4, geo_node): '''Transforms the part according to the ldraw matrix and adjusts for the houdini coord sys.''' # compensate for houdini coord sys - # convert from LDU to metric (1 LDU = 0.4mm), however we multiply by 100, - # so 1 brick is 0.8m wide and a minifigure is therefore *very roughly* human scale (3.84 meters tall) - # m4_part = hou.hmath.buildRotate(-180, 0, 0) + # convert from LDU to metric (1 LDU = 0.4mm), however we multiply by 10, + # so a 1x1 brick is 8 cm wide and a minifigure is therefore (38.4 cm tall) + # hopefully this is the right balance to get stable sims and stay in the safe floating point zone transform_dict = dict() transform_dict['rotate'] = (-180, 0, 0) - transform_dict['scale'] = (0.04, 0.04, 0.04) + transform_dict['scale'] = (0.004, 0.004, 0.004) m4_part = hou.hmath.buildTransform(transform_dict, transform_order="srt", rotate_order="xyz") m4 = m4*m4_part tr = m4.explode() @@ -150,7 +150,7 @@ def transform_part(node, m4, geo_node): # compensate for houdini coord sys t.parm('rx').set(180) - t.parm('scale').set(25) + t.parm('scale').set(250) return t diff --git a/resources/example_scene.hiplc b/resources/example_scene.hiplc index dbb686f..590adb3 100644 Binary files a/resources/example_scene.hiplc and b/resources/example_scene.hiplc differ diff --git a/resources/example_scene.ldr b/resources/example_scene.ldr index eb50749..4df4629 100644 --- a/resources/example_scene.ldr +++ b/resources/example_scene.ldr @@ -8,7 +8,7 @@ 1 14 110 -88 -10 0 0 -1 0 1 0 1 0 0 3626b.dat 1 1 80 -24 10 1 0 0 0 1 0 0 0 1 3298p90.dat 1 13 10 -48 -10 0 0 1 0 1 0 -1 0 0 4599a.dat -1 256 40 -24 0 0 0 1 0 1 0 -1 0 0 92409.dat +1 256 40 -22 0 0 0 1 0 1 0 -1 0 0 92409.dat 1 15 110 -56 -10 0 0 1 0 1 0 -1 0 0 2335p30.dat 1 4 70 -24 10 1 0 0 0 1 0 0 0 1 2546p01.dat 1 2 -10 -32 30 0 0 1 0 1 0 -1 0 0 3741a.dat