From 8b6235f42fe098c6b7bd9e65177c6df14a0d0c40 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 21 Jun 2024 16:51:33 +0500 Subject: [PATCH] fix TessellateElements ifcpatch recipe TessellateElements patch was failing because it was relying on optionality of `edges` argument. Though argument itself is currently useless and not used in the code. --- .../ifcopenshell/api/geometry/add_mesh_representation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/geometry/add_mesh_representation.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/add_mesh_representation.py index e26c5c39b8..efe6aa5c89 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/geometry/add_mesh_representation.py +++ b/src/ifcopenshell-python/ifcopenshell/api/geometry/add_mesh_representation.py @@ -32,10 +32,10 @@ def add_mesh_representation( vertices: list[COORD_3D], # A list of edges, represented by vertex index pairs # ... where itemN = [(0, 1), (1, 2), (v1, v2), ...] - edges: list[tuple[int, int]], + edges: list[tuple[int, int]] = None, # A list of polygons, represented by vertex indices # ... where itemN = [(0, 1, 2), (5, 4, 2, 3), (v1, v2, v3, ... vN), ...] - faces: list[list[int]], + faces: list[list[int]] = None, # Optionally apply a vector offset to all coordinates cooridnate_offset: Optional[COORD_3D] = None, # A scale factor to apply for all vectors in case the unit is different @@ -43,6 +43,8 @@ def add_mesh_representation( # Force using IfcFacetedBreps instead of IfcPolygonalFaceSets force_faceted_brep: bool = False, ) -> ifcopenshell.entity_instance: + # TODO: Support edges without faces. + assert faces is not None, f"Currently 'faces' argument is not optional." usecase = Usecase() usecase.file = file usecase.settings = {