mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Fix #5988 after 6fb0f5e63a
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user