Fixed windows/openings bugs

1) Window bug (#2792) - lining_offset wasn't converted from ifc units during window properties editing
2) Openings bug - OveallWidth/OverallHeight based openings was converted to ifc units even though their dimensions were already in ifc units.
This commit is contained in:
Andrej730
2023-02-21 11:19:38 +05:00
parent 2429f507ad
commit 66b7692227
2 changed files with 5 additions and 4 deletions
@@ -224,6 +224,7 @@ class FilledOpeningGenerator:
x, y, z = filling_obj.dimensions
opening_position = Vector([0.0, -0.1 / unit_scale, 0.0])
opening_size = Vector([x, 0, z]) / unit_scale
# Windows and doors can have a casing that overlaps the wall
# but shouldn't affect the size of the opening.
@@ -232,10 +233,10 @@ class FilledOpeningGenerator:
x_redefined, z_redefined = False, False
if filling.is_a() in ["IfcWindow", "IfcDoor"]:
if filling.OverallWidth:
x = filling.OverallWidth
opening_size.x = filling.OverallWidth
x_redefined = True
if filling.OverallHeight:
z = filling.OverallHeight
opening_size.z = filling.OverallHeight
z_redefined = True
# making sure if min_x or min_z != 0 to shift the opening accordingly
@@ -247,7 +248,7 @@ class FilledOpeningGenerator:
opening_position.z = min(v[2] for v in filling_obj.bound_box)
extrusion = shape_builder.extrude(
shape_builder.rectangle(size=Vector([x / unit_scale, 0.0, z / unit_scale])),
shape_builder.rectangle(size=opening_size),
magnitude=thickness / unit_scale,
position=opening_position,
extrusion_vector=Vector([0.0, 1.0, 0.0]),
@@ -300,7 +300,7 @@ def update_window_modifier_bmesh(context):
lining_to_panel_offset_x = props.lining_to_panel_offset_x * si_conversion
lining_to_panel_offset_y = props.lining_to_panel_offset_y * si_conversion
lining_thickness = props.lining_thickness * si_conversion
lining_offset = props.lining_offset
lining_offset = props.lining_offset * si_conversion
mullion_thickness = props.mullion_thickness * si_conversion / 2
first_mullion_offset = props.first_mullion_offset * si_conversion