mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 02:07:36 +00:00
Handle corrupt geometry caches (e.g. due to crash) by creating a fresh cache.
This commit is contained in:
@@ -93,6 +93,10 @@ class IfcStore:
|
|||||||
IfcStore.cache_path = os.path.join(bpy.context.scene.BIMProperties.data_dir, "cache", f"{ifc_hash}.h5")
|
IfcStore.cache_path = os.path.join(bpy.context.scene.BIMProperties.data_dir, "cache", f"{ifc_hash}.h5")
|
||||||
cache_settings = ifcopenshell.geom.settings()
|
cache_settings = ifcopenshell.geom.settings()
|
||||||
cache_settings.set(cache_settings.STRICT_TOLERANCE, True)
|
cache_settings.set(cache_settings.STRICT_TOLERANCE, True)
|
||||||
|
try:
|
||||||
|
IfcStore.cache = ifcopenshell.geom.serializers.hdf5(IfcStore.cache_path, cache_settings)
|
||||||
|
except:
|
||||||
|
os.remove(IfcStore.cache_path)
|
||||||
try:
|
try:
|
||||||
IfcStore.cache = ifcopenshell.geom.serializers.hdf5(IfcStore.cache_path, cache_settings)
|
IfcStore.cache = ifcopenshell.geom.serializers.hdf5(IfcStore.cache_path, cache_settings)
|
||||||
except:
|
except:
|
||||||
|
|||||||
Reference in New Issue
Block a user