mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 03:05:33 +00:00
#2224 Cache seems unstable for some large models so allow option to disable
This commit is contained in:
@@ -683,9 +683,10 @@ class IfcImporter:
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
iterator = ifcopenshell.geom.iterator(self.settings, self.file, include=products)
|
iterator = ifcopenshell.geom.iterator(self.settings, self.file, include=products)
|
||||||
cache = IfcStore.get_cache()
|
if self.ifc_import_settings.should_cache:
|
||||||
if cache:
|
cache = IfcStore.get_cache()
|
||||||
iterator.set_cache(cache)
|
if cache:
|
||||||
|
iterator.set_cache(cache)
|
||||||
valid_file = iterator.initialize()
|
valid_file = iterator.initialize()
|
||||||
if not valid_file:
|
if not valid_file:
|
||||||
return results
|
return results
|
||||||
@@ -832,9 +833,10 @@ class IfcImporter:
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
iterator = ifcopenshell.geom.iterator(self.settings_2d, self.file, include=products)
|
iterator = ifcopenshell.geom.iterator(self.settings_2d, self.file, include=products)
|
||||||
cache = IfcStore.get_cache()
|
if self.ifc_import_settings.should_cache:
|
||||||
if cache:
|
cache = IfcStore.get_cache()
|
||||||
iterator.set_cache(cache)
|
if cache:
|
||||||
|
iterator.set_cache(cache)
|
||||||
valid_file = iterator.initialize()
|
valid_file = iterator.initialize()
|
||||||
if not valid_file:
|
if not valid_file:
|
||||||
return results
|
return results
|
||||||
@@ -1925,6 +1927,7 @@ class IfcImportSettings:
|
|||||||
self.should_merge_materials_by_colour = False
|
self.should_merge_materials_by_colour = False
|
||||||
self.should_use_native_meshes = False
|
self.should_use_native_meshes = False
|
||||||
self.should_clean_mesh = True
|
self.should_clean_mesh = True
|
||||||
|
self.should_cache = True
|
||||||
self.deflection_tolerance = 0.001
|
self.deflection_tolerance = 0.001
|
||||||
self.angular_tolerance = 0.5
|
self.angular_tolerance = 0.5
|
||||||
self.distance_limit = 1000
|
self.distance_limit = 1000
|
||||||
@@ -1953,6 +1956,7 @@ class IfcImportSettings:
|
|||||||
settings.should_merge_materials_by_colour = props.should_merge_materials_by_colour
|
settings.should_merge_materials_by_colour = props.should_merge_materials_by_colour
|
||||||
settings.should_use_native_meshes = props.should_use_native_meshes
|
settings.should_use_native_meshes = props.should_use_native_meshes
|
||||||
settings.should_clean_mesh = props.should_clean_mesh
|
settings.should_clean_mesh = props.should_clean_mesh
|
||||||
|
settings.should_cache = props.should_cache
|
||||||
settings.deflection_tolerance = props.deflection_tolerance
|
settings.deflection_tolerance = props.deflection_tolerance
|
||||||
settings.angular_tolerance = props.angular_tolerance
|
settings.angular_tolerance = props.angular_tolerance
|
||||||
settings.distance_limit = props.distance_limit
|
settings.distance_limit = props.distance_limit
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ class BIMProjectProperties(PropertyGroup):
|
|||||||
should_merge_materials_by_colour: BoolProperty(name="Import and Merge Materials by Colour", default=False)
|
should_merge_materials_by_colour: BoolProperty(name="Import and Merge Materials by Colour", default=False)
|
||||||
should_clean_mesh: BoolProperty(name="Import and Clean Mesh", default=True)
|
should_clean_mesh: BoolProperty(name="Import and Clean Mesh", default=True)
|
||||||
should_use_native_meshes: BoolProperty(name="Native Meshes", default=False)
|
should_use_native_meshes: BoolProperty(name="Native Meshes", default=False)
|
||||||
|
should_cache: BoolProperty(name="Cache", default=False)
|
||||||
deflection_tolerance: FloatProperty(name="Deflection Tolerance", default=0.001)
|
deflection_tolerance: FloatProperty(name="Deflection Tolerance", default=0.001)
|
||||||
angular_tolerance: FloatProperty(name="Angular Tolerance", default=0.5)
|
angular_tolerance: FloatProperty(name="Angular Tolerance", default=0.5)
|
||||||
distance_limit: FloatProperty(name="Distance Limit", default=1000)
|
distance_limit: FloatProperty(name="Distance Limit", default=1000)
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ class BIM_PT_project(Panel):
|
|||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.prop(pprops, "should_merge_by_class")
|
row.prop(pprops, "should_merge_by_class")
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
|
row.prop(pprops, "should_cache")
|
||||||
row.prop(pprops, "should_merge_by_material")
|
row.prop(pprops, "should_merge_by_material")
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.prop(pprops, "should_use_native_meshes")
|
row.prop(pprops, "should_use_native_meshes")
|
||||||
|
|||||||
Reference in New Issue
Block a user