See #1227. Reimplement extend walls to slab (or anything with negative Z faces)

There are a few differences to the previous implementation:

 1. It is no longer recalculated on wall regeneration. The new wall
regeneration is strict to the spec on the rules of rel connects path,
and so this being a "userdefined" connection we only calculate it
explicitly when the user invokes the operator.
 2. It uses meshes instead of clipping planes, so you can clip to
strange shapes or gable roofs or whatever. Nice.
This commit is contained in:
Dion Moult
2025-03-12 18:05:51 +11:00
parent a7a4198fc1
commit f5a1c4aae3
8 changed files with 166 additions and 18 deletions
@@ -721,6 +721,26 @@ def get_extrusions(element: ifcopenshell.entity_instance) -> Union[list[ifcopens
return extrusions
def get_base_extrusions(element: ifcopenshell.entity_instance) -> Union[list[ifcopenshell.entity_instance], None]:
"""Gets all base extrusions used to define an element's model body geometry
A base extrusion is assumed to be an extrusion prior to all boolean
results.
:param element: The element occurrence
:return: A list of extrusion representation items or `None` if element has no representation.
"""
if not (rep := ifcopenshell.util.representation.get_representation(element, "Model", "Body", "MODEL_VIEW")):
return
extrusions = []
for item in ifcopenshell.util.representation.resolve_representation(rep).Items:
while item.is_a("IfcBooleanResult"):
item = item.FirstOperand
if item.is_a("IfcExtrudedAreaSolid"):
extrusions.append(item)
return extrusions
def get_total_edge_length(geometry: ShapeType) -> float:
"""Calculates the total length of edges in a given geometry.