diff --git a/src/ifcblenderexport/blenderbim/bim/export_ifc.py b/src/ifcblenderexport/blenderbim/bim/export_ifc.py index f43d4cfef6..4d157dd290 100644 --- a/src/ifcblenderexport/blenderbim/bim/export_ifc.py +++ b/src/ifcblenderexport/blenderbim/bim/export_ifc.py @@ -1,5 +1,6 @@ import bpy import csv +import bmesh import json import time import datetime @@ -2951,6 +2952,14 @@ class IfcExporter: mesh = representation["raw"] if not representation["is_parametric"]: mesh = representation["raw_object"].evaluated_get(bpy.context.evaluated_depsgraph_get()).to_mesh() + if self.ifc_export_settings.should_force_triangulation: + mesh = representation["raw_object"].evaluated_get(bpy.context.evaluated_depsgraph_get()).to_mesh() + bm = bmesh.new() + bm.from_mesh(mesh) + bmesh.ops.triangulate(bm, faces=bm.faces) + bm.to_mesh(mesh) + bm.free() + del bm if self.schema_version == "IFC2X3" or self.ifc_export_settings.should_force_faceted_brep: return self.create_faceted_brep(representation, mesh) return self.create_polygonal_face_set(representation, mesh) @@ -3342,6 +3351,7 @@ class IfcExportSettings: settings.should_use_presentation_style_assignment = scene_bim.export_should_use_presentation_style_assignment settings.should_guess_quantities = scene_bim.export_should_guess_quantities settings.should_force_faceted_brep = scene_bim.export_should_force_faceted_brep + settings.should_force_triangulation = scene_bim.export_should_force_triangulation settings.should_roundtrip_native = scene_bim.import_export_should_roundtrip_native settings.context_tree = [] for ifc_context in ["model", "plan"]: diff --git a/src/ifcblenderexport/blenderbim/bim/prop.py b/src/ifcblenderexport/blenderbim/bim/prop.py index 32139193b1..76660ae2f5 100644 --- a/src/ifcblenderexport/blenderbim/bim/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/prop.py @@ -1381,6 +1381,7 @@ class BIMProperties(PropertyGroup): name="Export with Presentation Style Assignment", default=False ) export_should_force_faceted_brep: BoolProperty(name="Export with Faceted Breps", default=False) + export_should_force_triangulation: BoolProperty(name="Export with Triangulation", default=False) import_should_ignore_site_coordinates: BoolProperty(name="Import Ignoring Site Coordinates", default=False) import_should_ignore_building_coordinates: BoolProperty(name="Import Ignoring Building Coordinates", default=False) import_should_reset_absolute_coordinates: BoolProperty(name="Import Resetting Absolute Coordinates", default=False) diff --git a/src/ifcblenderexport/blenderbim/bim/ui.py b/src/ifcblenderexport/blenderbim/bim/ui.py index 06340124ba..6348f4863f 100644 --- a/src/ifcblenderexport/blenderbim/bim/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/ui.py @@ -1845,6 +1845,11 @@ class BIM_PT_mvd(Panel): row = layout.row() row.prop(bim_properties, "export_should_force_faceted_brep") + layout.label(text="Navisworks Workarounds:") + + row = layout.row() + row.prop(bim_properties, "export_should_force_triangulation") + layout.label(text="Tekla Workarounds:") row = layout.row()