mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
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:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user