mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Purge option for native meshes
This commit is contained in:
@@ -263,6 +263,8 @@ class IfcImporter:
|
||||
self.profile_code("Create element types")
|
||||
self.place_objects_in_collections()
|
||||
self.profile_code("Place objects in collections")
|
||||
self.setup_arrays()
|
||||
self.profile_code("Setup arrays")
|
||||
self.add_project_to_scene()
|
||||
self.profile_code("Add project to scene")
|
||||
if self.ifc_import_settings.should_clean_mesh and len(self.file.by_type("IfcElement")) < 1000:
|
||||
@@ -275,8 +277,6 @@ class IfcImporter:
|
||||
self.profile_code("Setting default context")
|
||||
if self.ifc_import_settings.should_setup_viewport_camera:
|
||||
self.setup_viewport_camera()
|
||||
self.setup_arrays()
|
||||
self.profile_code("Setup arrays")
|
||||
tool.Spatial.run_spatial_import_spatial_decomposition()
|
||||
if default_container := tool.Spatial.guess_default_container():
|
||||
tool.Spatial.set_default_container(default_container)
|
||||
@@ -358,6 +358,8 @@ class IfcImporter:
|
||||
def parse_native_elements(self) -> None:
|
||||
if not self.ifc_import_settings.should_load_geometry:
|
||||
return
|
||||
if not self.file.by_type("IfcSweptDiskSolid"):
|
||||
return
|
||||
for element in self.elements:
|
||||
if self.is_native(element):
|
||||
self.native_elements.add(element)
|
||||
@@ -421,9 +423,6 @@ class IfcImporter:
|
||||
}
|
||||
return True
|
||||
|
||||
if not self.ifc_import_settings.should_use_native_meshes:
|
||||
return False # Performance improvements only occur on edge cases currently
|
||||
|
||||
def is_native_swept_disk_solid(
|
||||
self, element: ifcopenshell.entity_instance, representation: ifcopenshell.entity_instance
|
||||
) -> bool:
|
||||
@@ -1172,7 +1171,6 @@ class IfcImportSettings:
|
||||
self.should_use_cpu_multiprocessing = True
|
||||
self.should_merge_materials_by_colour = False
|
||||
self.should_load_geometry = True
|
||||
self.should_use_native_meshes = False
|
||||
self.should_clean_mesh = False
|
||||
self.should_cache = True
|
||||
self.deflection_tolerance = 0.001
|
||||
@@ -1209,7 +1207,6 @@ class IfcImportSettings:
|
||||
settings.should_use_cpu_multiprocessing = props.should_use_cpu_multiprocessing
|
||||
settings.should_merge_materials_by_colour = props.should_merge_materials_by_colour
|
||||
settings.should_load_geometry = props.should_load_geometry
|
||||
settings.should_use_native_meshes = props.should_use_native_meshes
|
||||
settings.should_clean_mesh = props.should_clean_mesh
|
||||
settings.should_cache = props.should_cache
|
||||
settings.deflection_tolerance = props.deflection_tolerance
|
||||
|
||||
@@ -170,7 +170,6 @@ class BIMProjectProperties(PropertyGroup):
|
||||
should_merge_materials_by_colour: BoolProperty(name="Merge Materials by Colour", default=False)
|
||||
should_stream: BoolProperty(name="Stream Data From IFC-SPF (Only for advanced users)", default=False)
|
||||
should_load_geometry: BoolProperty(name="Load Geometry", default=True)
|
||||
should_use_native_meshes: BoolProperty(name="Native Meshes", default=False)
|
||||
should_clean_mesh: BoolProperty(name="Clean Meshes", default=False)
|
||||
should_cache: BoolProperty(name="Cache", default=False)
|
||||
deflection_tolerance: FloatProperty(name="Deflection Tolerance", default=0.001)
|
||||
|
||||
@@ -172,8 +172,6 @@ class BIM_PT_project(Panel):
|
||||
row = self.layout.row()
|
||||
row.prop(pprops, "should_load_geometry")
|
||||
row = self.layout.row()
|
||||
row.prop(pprops, "should_use_native_meshes")
|
||||
row = self.layout.row()
|
||||
row.prop(pprops, "should_merge_materials_by_colour")
|
||||
row = self.layout.row()
|
||||
row.prop(pprops, "geometry_library")
|
||||
|
||||
Reference in New Issue
Block a user