Fix #3605. Bug where invalid representation type was created when booleans are added / removed.

This commit is contained in:
Dion Moult
2023-08-20 17:11:57 +10:00
parent f84c4ab2e5
commit d26a2580ea
2 changed files with 23 additions and 4 deletions
@@ -42,8 +42,13 @@ class Usecase:
self.file.remove(item)
ifcopenshell.util.element.remove_deep2(self.file, second_operand)
if not [i for i in representation.Items if i.is_a("IfcBooleanResult")]:
representation.RepresentationType == "SweptSolid"
item_classes = {i.is_a() for i in representation.Items}
if "IfcBooleanResult" in item_classes:
representation.RepresentationType = "CSG"
elif "IfcBooleanClippingResult" in item_classes:
representation.RepresentationType = "Clipping"
else:
representation.RepresentationType = "SweptSolid"
def get_representation(self, item):
for inverse in self.file.get_inverse(item):