mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 03:05:33 +00:00
Create shape debugger now includes time information.
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
|
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
import time
|
||||||
import logging
|
import logging
|
||||||
import ifcopenshell
|
import ifcopenshell
|
||||||
import ifcopenshell.util.placement
|
import ifcopenshell.util.placement
|
||||||
@@ -87,10 +88,7 @@ class ProfileImportIFC(bpy.types.Operator):
|
|||||||
import cProfile
|
import cProfile
|
||||||
import pstats
|
import pstats
|
||||||
|
|
||||||
# For Windows
|
cProfile.run("import bpy; bpy.ops.bim.load_project_elements()", "blender.prof")
|
||||||
filepath = context.scene.BIMProperties.ifc_file.replace("\\", "\\\\")
|
|
||||||
|
|
||||||
cProfile.run(f"import bpy; bpy.ops.import_ifc.bim(filepath='{filepath}')", "blender.prof")
|
|
||||||
p = pstats.Stats("blender.prof")
|
p = pstats.Stats("blender.prof")
|
||||||
p.sort_stats("cumulative").print_stats(50)
|
p.sort_stats("cumulative").print_stats(50)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
@@ -115,9 +113,10 @@ class CreateAllShapes(bpy.types.Operator):
|
|||||||
if element.GlobalId in excludes:
|
if element.GlobalId in excludes:
|
||||||
continue
|
continue
|
||||||
print(f"{i}/{total}:", element)
|
print(f"{i}/{total}:", element)
|
||||||
|
start = time.time()
|
||||||
try:
|
try:
|
||||||
shape = ifcopenshell.geom.create_shape(settings, element)
|
shape = ifcopenshell.geom.create_shape(settings, element)
|
||||||
print("Success", len(shape.geometry.verts), len(shape.geometry.edges), len(shape.geometry.faces))
|
print("Success", time.time()-start, len(shape.geometry.verts), len(shape.geometry.edges), len(shape.geometry.faces))
|
||||||
except:
|
except:
|
||||||
failures.append(element)
|
failures.append(element)
|
||||||
print("***** FAILURE *****")
|
print("***** FAILURE *****")
|
||||||
|
|||||||
Reference in New Issue
Block a user