mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 03:05:33 +00:00
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:
@@ -224,6 +224,7 @@ class FilledOpeningGenerator:
|
|||||||
|
|
||||||
x, y, z = filling_obj.dimensions
|
x, y, z = filling_obj.dimensions
|
||||||
opening_position = Vector([0.0, -0.1 / unit_scale, 0.0])
|
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
|
# Windows and doors can have a casing that overlaps the wall
|
||||||
# but shouldn't affect the size of the opening.
|
# but shouldn't affect the size of the opening.
|
||||||
@@ -232,10 +233,10 @@ class FilledOpeningGenerator:
|
|||||||
x_redefined, z_redefined = False, False
|
x_redefined, z_redefined = False, False
|
||||||
if filling.is_a() in ["IfcWindow", "IfcDoor"]:
|
if filling.is_a() in ["IfcWindow", "IfcDoor"]:
|
||||||
if filling.OverallWidth:
|
if filling.OverallWidth:
|
||||||
x = filling.OverallWidth
|
opening_size.x = filling.OverallWidth
|
||||||
x_redefined = True
|
x_redefined = True
|
||||||
if filling.OverallHeight:
|
if filling.OverallHeight:
|
||||||
z = filling.OverallHeight
|
opening_size.z = filling.OverallHeight
|
||||||
z_redefined = True
|
z_redefined = True
|
||||||
|
|
||||||
# making sure if min_x or min_z != 0 to shift the opening accordingly
|
# 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)
|
opening_position.z = min(v[2] for v in filling_obj.bound_box)
|
||||||
|
|
||||||
extrusion = shape_builder.extrude(
|
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,
|
magnitude=thickness / unit_scale,
|
||||||
position=opening_position,
|
position=opening_position,
|
||||||
extrusion_vector=Vector([0.0, 1.0, 0.0]),
|
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_x = props.lining_to_panel_offset_x * si_conversion
|
||||||
lining_to_panel_offset_y = props.lining_to_panel_offset_y * si_conversion
|
lining_to_panel_offset_y = props.lining_to_panel_offset_y * si_conversion
|
||||||
lining_thickness = props.lining_thickness * 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
|
mullion_thickness = props.mullion_thickness * si_conversion / 2
|
||||||
first_mullion_offset = props.first_mullion_offset * si_conversion
|
first_mullion_offset = props.first_mullion_offset * si_conversion
|
||||||
|
|||||||
Reference in New Issue
Block a user