You can now set facet tolerances (angular and deflection tolerance) when importing. See #766.

This commit is contained in:
Dion Moult
2020-09-15 15:59:52 +10:00
parent 85d77798c3
commit 2310bf628f
3 changed files with 11 additions and 0 deletions
@@ -251,6 +251,9 @@ class IfcImporter():
self.diff = None
self.file = None
self.settings = ifcopenshell.geom.settings()
self.settings.set_deflection_tolerance(self.ifc_import_settings.deflection_tolerance)
# Uncomment this when the latest IfcOpenBot build is ready
# self.settings.set_angular_tolerance(self.ifc_import_settings.angular_tolerance)
if self.ifc_import_settings.should_import_curves:
self.settings.set(self.settings.INCLUDE_CURVES, True)
self.settings_native = ifcopenshell.geom.settings()
@@ -2066,4 +2069,6 @@ class IfcImportSettings:
settings.should_merge_by_material = scene_bim.import_should_merge_by_material
settings.should_merge_materials_by_colour = scene_bim.import_should_merge_materials_by_colour
settings.should_clean_mesh = scene_bim.import_should_clean_mesh
settings.deflection_tolerance = scene_bim.import_deflection_tolerance
settings.angular_tolerance = scene_bim.import_angular_tolerance
return settings
@@ -1215,6 +1215,8 @@ class BIMProperties(PropertyGroup):
import_should_merge_by_material: BoolProperty(name="Import and Merge by Material", default=False)
import_should_merge_materials_by_colour: BoolProperty(name="Import and Merge Materials by Colour", default=False)
import_should_clean_mesh: BoolProperty(name="Import and Clean Mesh", default=True)
import_deflection_tolerance: FloatProperty(name="Import Deflection Tolerance", default=0.001)
import_angular_tolerance: FloatProperty(name="Import Angular Tolerance", default=0.5)
qa_reject_element_reason: StringProperty(name="Element Rejection Reason")
person: EnumProperty(items=getPersons, name="Person")
organisation: EnumProperty(items=getOrganisations, name="Organisation")
@@ -1700,6 +1700,10 @@ class BIM_PT_mvd(Panel):
row = layout.row()
row.prop(bim_properties, 'import_should_import_with_profiling')
row = layout.row()
row.prop(bim_properties, 'import_deflection_tolerance')
row = layout.row()
row.prop(bim_properties, 'import_angular_tolerance')
row = layout.row()
row.prop(bim_properties, 'export_json_compact')
layout.label(text='Simplifications:')