See #5972. Prioritise clipping results where possible.

This commit is contained in:
Dion Moult
2025-01-19 01:09:11 +11:00
parent e40644c4f6
commit a57a0eb4eb
@@ -106,7 +106,18 @@ def add_boolean(
first.Closed = True # For now, trust the user to do the right thing.
if second_item.is_a("IfcTesselatedFaceSet"):
second_item.Closed = True # For now, trust the user to do the right thing.
first = file.create_entity("IfcBooleanResult", operator, first, second_item)
if (
operator == "DIFFERENCE"
and second_item.is_a("IfcHalfSpaceSolid")
and (
first.is_a("IfcSweptAreaSolid")
or first.is_a("IfcSweptDiskSolid")
or first.is_a("IfcBooleanClippingResult")
)
):
first = file.create_entity("IfcBooleanClippingResult", operator, first, second_item)
else:
first = file.create_entity("IfcBooleanResult", operator, first, second_item)
booleans.append(first)
for inverse in to_replace: