Skip to content

Commit

Permalink
feat: finish BME prototype improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
yyc12345 committed Jan 20, 2025
1 parent cc74a2c commit b96550c
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 81 deletions.
2 changes: 1 addition & 1 deletion bbp_ng/OP_ADDS_bme.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def draw(self, context):
op_cfgs_visitor: UTIL_functions.CollectionVisitor[BBP_PG_bme_adder_cfgs]
op_cfgs_visitor = UTIL_functions.CollectionVisitor(self.bme_struct_cfgs)
# visit cfgs cache list to show cfg
layout.label(text="Prototype Configurations:", text_ctxt='BBP_OT_add_bme_struct/draw')
layout.label(text="Prototype Configurations", text_ctxt='BBP_OT_add_bme_struct/draw')
for (cfg, cfg_index) in self.bme_struct_cfg_index_cache:
# create box for cfgs
box_layout: bpy.types.UILayout = layout.box()
Expand Down
8 changes: 8 additions & 0 deletions bbp_ng/raw_jsons/1x1.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"identifier": "cv_triangle_side",
"skip": "False",
"params": {
"edge_length": "5",
"tip_offset": "2.5",
"height": "height",
"face": "(face[0], False, False, False, face[3], None)",
"is_sink": "is_sink"
Expand All @@ -35,6 +37,8 @@
"identifier": "cv_triangle_side",
"skip": "False",
"params": {
"edge_length": "5",
"tip_offset": "2.5",
"height": "height",
"face": "(face[0], False, False, False, face[5], None)",
"is_sink": "is_sink"
Expand All @@ -45,6 +49,8 @@
"identifier": "cv_triangle_side",
"skip": "False",
"params": {
"edge_length": "5",
"tip_offset": "2.5",
"height": "height",
"face": "(face[0], False, False, False, face[2], None)",
"is_sink": "is_sink"
Expand All @@ -55,6 +61,8 @@
"identifier": "cv_triangle_side",
"skip": "False",
"params": {
"edge_length": "5",
"tip_offset": "2.5",
"height": "height",
"face": "(face[0], False, False, False, face[4], None)",
"is_sink": "is_sink"
Expand Down
50 changes: 33 additions & 17 deletions bbp_ng/raw_jsons/chris_vanilla.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
"params": {
"height": "height",
"length": "distance(0, 0, short_edge_offset, 2.5)",
"is_left_sink": "is_sink",
"is_right_sink": "False"
"is_left_sink": "False",
"is_right_sink": "is_sink"
},
"transform": "rot(0, 0, angle(0, 0, short_edge_offset, 2.5)) @ scale(1, -1, 1)"
},
Expand All @@ -134,7 +134,7 @@
"skip": "not face[5]",
"params": {
"height": "height",
"length": "length",
"length": "short_edge_length",
"is_left_sink": "is_sink",
"is_right_sink": "is_sink"
},
Expand All @@ -157,6 +157,14 @@
"identifier": "cv_triangle_side",
"showcase": null,
"params": [
{
"field": "edge_length",
"data": "5.0"
},
{
"field": "tip_offset",
"data": "2.5"
},
{
"field": "height",
"data": "5.0"
Expand All @@ -170,8 +178,16 @@
"data": "False"
}
],
"skip": "False",
"skip": "edge_length == 0.0",
"vars": [
{
"field": "edge_uv_length",
"data": "edge_length / 5.0"
},
{
"field": "tip_uv_offset",
"data": "tip_offset / 5.0"
},
{
"field": "sink",
"data": "0.7 if is_sink else 0.0"
Expand All @@ -184,11 +200,11 @@
},
{
"skip": "not face[0]",
"data": "(2.5, 2.5, -sink)"
"data": "(tip_offset, 2.5, -sink)"
},
{
"skip": "not face[0]",
"data": "(5.0, 0, 0)"
"data": "(edge_length, 0, 0)"
}
],
"faces": [
Expand All @@ -198,8 +214,8 @@
"indices": [0, 2, 1],
"uvs": [
"(0, 0)",
"(0, 1)",
"(0.5, 0.5)"
"(0, edge_uv_length)",
"(0.5, tip_uv_offset)"
],
"normals": null
}
Expand All @@ -210,7 +226,7 @@
"skip": "not face[4]",
"params": {
"height": "height",
"length": "5",
"length": "edge_length",
"is_left_sink": "False",
"is_right_sink": "False"
},
Expand All @@ -221,30 +237,30 @@
"skip": "not face[2]",
"params": {
"height": "height",
"length": "distance(0, 0, 2.5, 2.5)",
"is_left_sink": "is_sink",
"is_right_sink": "False"
"length": "distance(0, 0, tip_offset, 2.5)",
"is_left_sink": "False",
"is_right_sink": "is_sink"
},
"transform": "rot(0, 0, 45) @ scale(1, -1, 1)"
"transform": "rot(0, 0, angle(0, 0, tip_offset, 2.5)) @ scale(1, -1, 1)"
},
{
"identifier": "raw_floor_side",
"skip": "not face[3]",
"params": {
"height": "height",
"length": "distance(5, 0, 2.5, 2.5)",
"length": "distance(edge_length, 0, tip_offset, 2.5)",
"is_left_sink": "False",
"is_right_sink": "is_sink"
},
"transform": "move(5, 0, 0) @ rot(0, 0, 135)"
"transform": "move(edge_length, 0, 0) @ rot(0, 0, angle(edge_length, 0, tip_offset, 2.5))"
},
{
"identifier": "floor_triangle_bottom",
"skip": "not face[1]",
"params": {
"length": "5.0",
"length": "edge_length",
"width": "2.5",
"tip_offset": "2.5"
"tip_offset": "tip_offset"
},
"transform": "move(0, 0, -height)"
}
Expand Down
6 changes: 6 additions & 0 deletions bbp_ng/raw_jsons/crossings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"identifier": "cv_triangle_side",
"skip": "False",
"params": {
"edge_length": "5",
"tip_offset": "2.5",
"height": "height",
"face": "(face[0], False, False, False, face[4], None)",
"is_sink": "is_sink"
Expand Down Expand Up @@ -55,6 +57,8 @@
"identifier": "cv_triangle_side",
"skip": "False",
"params": {
"edge_length": "5",
"tip_offset": "2.5",
"height": "height",
"face": "(face[0], False, False, False, face[2], None)",
"is_sink": "is_sink"
Expand Down Expand Up @@ -128,6 +132,8 @@
"identifier": "cv_triangle_side",
"skip": "False",
"params": {
"edge_length": "5",
"tip_offset": "2.5",
"height": "height",
"face": "(face[0], False, False, False, face[2], None)",
"is_sink": "is_sink"
Expand Down
24 changes: 10 additions & 14 deletions bbp_ng/raw_jsons/terminals.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,32 @@
"identifier": "cv_triangle_side",
"skip": "False",
"params": {
"edge_length": "2.5",
"tip_offset": "2.5",
"height": "height",
"face": "(face[0], False, False, False, face[4], None)",
"face": "(face[0], False, False, face[3], face[4], None)",
"is_sink": "is_sink"
},
"transform": "ident()"
},
{
"identifier": "cv_triangle_center",
"skip": "False",
"params": {
"height": "height",
"face": "(face[0], False, False, False, face[3], None)",
"is_sink": "is_sink"
},
"transform": "move(5, 0, 0) @ rot(0, 0, 90)"
},
{
"identifier": "cv_triangle_side",
"skip": "False",
"params": {
"edge_length": "2.5",
"tip_offset": "2.5",
"height": "height",
"face": "(face[0], False, False, False, face[5], None)",
"face": "(face[0], False, False, face[3], face[5], None)",
"is_sink": "is_sink"
},
"transform": "move(5, 5, 0) @ rot(0, 0, 180)"
"transform": "move(0, 5, 0) @ scale(1, -1, 1)"
},
{
"identifier": "cv_triangle_side",
"skip": "False",
"params": {
"edge_length": "5",
"tip_offset": "2.5",
"height": "height",
"face": "(face[0], False, False, False, face[2], None)",
"is_sink": "is_sink"
Expand All @@ -65,7 +61,7 @@
"identifier": "floor_rectangle_bottom",
"skip": "not face[1]",
"params": {
"length": "5",
"length": "2.5",
"width": "5"
},
"transform": "move(0, 0, -height)"
Expand Down
Loading

0 comments on commit b96550c

Please sign in to comment.