mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Error on tessellation request in IFC2X3
IfcTriangulatedFaceSet/IfcPolygonalFaceSet were introduced in Fix #7992: IFC4 and do not exist in IFC2X3. Previously, requesting an IfcTessellatedFaceSet representation in an IFC2X3 file silently fell back to a faceted brep after unassigning material sets. Add a guard in the update_representation operator (user-facing error) and in the add_representation API (ValueError) so the unsupported request is caught instead of failing silently. Generated with the assistance of an AI coding tool.
This commit is contained in:
@@ -121,6 +121,12 @@ class Usecase:
|
||||
blender_object: bpy.types.Object
|
||||
|
||||
def execute(self) -> Union[ifcopenshell.entity_instance, None]:
|
||||
# IfcTriangulatedFaceSet/IfcPolygonalFaceSet were introduced in IFC4 and
|
||||
# do not exist in IFC2X3. Without this guard create_mesh_representation()
|
||||
# silently falls back to a faceted brep, ignoring the requested class.
|
||||
if self.settings["ifc_representation_class"] == "IfcTessellatedFaceSet" and self.file.schema == "IFC2X3":
|
||||
raise ValueError("Tessellated face sets (IfcTessellatedFaceSet) are not supported in IFC2X3.")
|
||||
|
||||
self.is_manifold = None
|
||||
self.coordinate_offset = self.settings["coordinate_offset"]
|
||||
self.geometry = self.settings["geometry"]
|
||||
|
||||
Reference in New Issue
Block a user