mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 04:04:00 +00:00
Add has_underside_connection method to Model class and update wall regeneration logic
This commit is contained in:
committed by
Ryan Schultz
parent
d6662e5c56
commit
bfb4312906
@@ -1294,10 +1294,7 @@ class Hotkey(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
bpy.ops.bim.generate_space()
|
bpy.ops.bim.generate_space()
|
||||||
return
|
return
|
||||||
if self.active_material_usage == "LAYER2":
|
if self.active_material_usage == "LAYER2":
|
||||||
if element and any(
|
if element and tool.Model.has_underside_connection(element):
|
||||||
rel.is_a("IfcRelConnectsElements") and rel.Description == "TOP"
|
|
||||||
for rel in element.ConnectedFrom
|
|
||||||
):
|
|
||||||
bpy.ops.bim.regenerate_wall_to_underside()
|
bpy.ops.bim.regenerate_wall_to_underside()
|
||||||
else:
|
else:
|
||||||
bpy.ops.bim.recalculate_wall()
|
bpy.ops.bim.recalculate_wall()
|
||||||
|
|||||||
@@ -683,6 +683,7 @@ class Model:
|
|||||||
def get_extrusion(cls, representation): pass
|
def get_extrusion(cls, representation): pass
|
||||||
def get_connected_slab_objs(cls, wall): pass
|
def get_connected_slab_objs(cls, wall): pass
|
||||||
def get_connected_wall_objs(cls, slab): pass
|
def get_connected_wall_objs(cls, slab): pass
|
||||||
|
def has_underside_connection(cls, element): pass
|
||||||
def get_manual_booleans(cls, element): pass
|
def get_manual_booleans(cls, element): pass
|
||||||
def get_material_layer_parameters(cls, element): pass
|
def get_material_layer_parameters(cls, element): pass
|
||||||
def get_slab_clipping_bmesh(cls, obj): pass
|
def get_slab_clipping_bmesh(cls, obj): pass
|
||||||
|
|||||||
@@ -867,6 +867,11 @@ class Model(bonsai.core.tool.Model):
|
|||||||
result.append(wall_obj)
|
result.append(wall_obj)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def has_underside_connection(cls, element: ifcopenshell.entity_instance) -> bool:
|
||||||
|
"""Return True if element has an IfcRelConnectsElements(TOP) relationship."""
|
||||||
|
return any(rel.is_a("IfcRelConnectsElements") and rel.Description == "TOP" for rel in element.ConnectedFrom)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def remove_wall_to_underside_booleans(cls, wall: ifcopenshell.entity_instance) -> None:
|
def remove_wall_to_underside_booleans(cls, wall: ifcopenshell.entity_instance) -> None:
|
||||||
"""Remove all IfcBooleanResult items previously added by extend_walls_to_underside."""
|
"""Remove all IfcBooleanResult items previously added by extend_walls_to_underside."""
|
||||||
@@ -2706,9 +2711,7 @@ class Model(bonsai.core.tool.Model):
|
|||||||
|
|
||||||
if operands:
|
if operands:
|
||||||
body_repr = ifcopenshell.util.representation.get_representation(wall, "Model", "Body", "MODEL_VIEW")
|
body_repr = ifcopenshell.util.representation.get_representation(wall, "Model", "Body", "MODEL_VIEW")
|
||||||
booleans = ifcopenshell.api.geometry.add_boolean(
|
booleans = ifcopenshell.api.geometry.add_boolean(ifc_file, first_item=extrusion, second_items=operands)
|
||||||
ifc_file, first_item=extrusion, second_items=operands
|
|
||||||
)
|
|
||||||
tool.Model.mark_manual_booleans(wall, booleans)
|
tool.Model.mark_manual_booleans(wall, booleans)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user