Clean up IfcIndexedColourMap removing representation #4138

Because we wasn't removing colour map, remove_representation was producing orphaned IfcPolygonalFaceSet that were referred by colour map.
This commit is contained in:
Andrej730
2023-12-26 11:24:49 +05:00
parent 54c689d615
commit 0fbe4d80c7
2 changed files with 14 additions and 1 deletions
@@ -100,6 +100,14 @@ class TestRemoveRepresentation(test.bootstrap.IFC4):
ifcopenshell.api.run("geometry.remove_representation", self.file, representation=representation)
assert len(self.file.by_type("IfcGeometricRepresentationContext")) == 1
def test_purging_colour_map(self):
item = self.file.createIfcTriangulatedFaceSet()
representation = self.file.createIfcShapeRepresentation(Items=[item])
colour = self.file.createIfcIndexedColourMap(Colours=self.file.createIfcColourRgbList(), MappedTo=item)
ifcopenshell.api.run("geometry.remove_representation", self.file, representation=representation)
assert len(self.file.by_type("IfcIndexedColourMap")) == 0
assert len(self.file.by_type("IfcColourRgbList")) == 0
def test_purging_texture_coordinates(self):
item = self.file.createIfcTriangulatedFaceSet()
representation = self.file.createIfcShapeRepresentation(Items=[item])