From bad6931a84a1e0c7a578fc5b66b4a9ba35fced73 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 11 Sep 2024 12:26:39 +1000 Subject: [PATCH] Fix bug in tessellate elements --- src/ifcpatch/ifcpatch/recipes/TessellateElements.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifcpatch/ifcpatch/recipes/TessellateElements.py b/src/ifcpatch/ifcpatch/recipes/TessellateElements.py index 0769e2027e..06929cea59 100644 --- a/src/ifcpatch/ifcpatch/recipes/TessellateElements.py +++ b/src/ifcpatch/ifcpatch/recipes/TessellateElements.py @@ -92,7 +92,7 @@ class Patcher: ) -> None: geometry = getattr(shape, "geometry", shape) v = [[x.tolist() for x in ifcopenshell.util.shape.get_vertices(geometry)]] - f = [ifcopenshell.util.shape.get_faces(geometry)] + f = [ifcopenshell.util.shape.get_faces(geometry).tolist()] replacements[element] = (v, f) iterator = ifcopenshell.geom.iterator(settings, self.file, multiprocessing.cpu_count(), include=products) @@ -112,6 +112,8 @@ class Patcher: # Do the replacements outside the iterator to prevent messing up iterator state. for element, geometry in replacements.items(): v, f = geometry + if not v or not f: + continue mesh = ifcopenshell.api.run( "geometry.add_mesh_representation", self.file,