This commit is contained in:
Andrej730
2025-01-17 15:23:59 +05:00
parent e1da08579c
commit 686a5e7387
+8 -9
View File
@@ -662,28 +662,27 @@ class Model(bonsai.core.tool.Model):
return "PROFILE"
@classmethod
def get_wall_axis(
cls, obj: bpy.types.Object, layers: Optional[dict[str, Any]] = None
) -> dict[str, tuple[Vector, Vector]]:
def get_wall_axis(cls, obj: bpy.types.Object, layers: Optional[dict[str, Any]] = None) -> dict[str, list[Vector]]:
"""Each item of a resulting dictionary is a list of 2 2D vectors."""
x_values = [v[0] for v in obj.bound_box]
min_x = min(x_values)
max_x = max(x_values)
axes = {}
if layers:
axes = {
"base": (
"base": [
(obj.matrix_world @ Vector((min_x, layers["offset"], 0.0))).to_2d(),
(obj.matrix_world @ Vector((max_x, layers["offset"], 0.0))).to_2d(),
),
"side": (
],
"side": [
(obj.matrix_world @ Vector((min_x, layers["offset"] + layers["thickness"], 0.0))).to_2d(),
(obj.matrix_world @ Vector((max_x, layers["offset"] + layers["thickness"], 0.0))).to_2d(),
),
],
}
axes["reference"] = (
axes["reference"] = [
(obj.matrix_world @ Vector((min_x, 0.0, 0.0))).to_2d(),
(obj.matrix_world @ Vector((max_x, 0.0, 0.0))).to_2d(),
)
]
return axes
@classmethod