mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 22:11:36 +00:00
Test all shapes in the debug panel now also attempts 2D checks to prevent false positives.
This commit is contained in:
@@ -190,6 +190,8 @@ class CreateAllShapes(bpy.types.Operator):
|
|||||||
|
|
||||||
total = len(elements)
|
total = len(elements)
|
||||||
settings = ifcopenshell.geom.settings()
|
settings = ifcopenshell.geom.settings()
|
||||||
|
settings_2d = ifcopenshell.geom.settings()
|
||||||
|
settings_2d.set(settings_2d.INCLUDE_CURVES, True)
|
||||||
failures = []
|
failures = []
|
||||||
excludes = () # For the developer to debug with
|
excludes = () # For the developer to debug with
|
||||||
for i, element in enumerate(elements):
|
for i, element in enumerate(elements):
|
||||||
@@ -197,8 +199,16 @@ class CreateAllShapes(bpy.types.Operator):
|
|||||||
continue
|
continue
|
||||||
print(f"{i}/{total}:", element)
|
print(f"{i}/{total}:", element)
|
||||||
start = time.time()
|
start = time.time()
|
||||||
|
shape = None
|
||||||
try:
|
try:
|
||||||
shape = ifcopenshell.geom.create_shape(settings, element)
|
shape = ifcopenshell.geom.create_shape(settings, element)
|
||||||
|
except:
|
||||||
|
try:
|
||||||
|
shape = ifcopenshell.geom.create_shape(settings_2d, element)
|
||||||
|
except:
|
||||||
|
failures.append(element)
|
||||||
|
print("***** FAILURE *****")
|
||||||
|
if shape:
|
||||||
print(
|
print(
|
||||||
"Success",
|
"Success",
|
||||||
time.time() - start,
|
time.time() - start,
|
||||||
@@ -206,9 +216,6 @@ class CreateAllShapes(bpy.types.Operator):
|
|||||||
len(shape.geometry.edges),
|
len(shape.geometry.edges),
|
||||||
len(shape.geometry.faces),
|
len(shape.geometry.faces),
|
||||||
)
|
)
|
||||||
except:
|
|
||||||
failures.append(element)
|
|
||||||
print("***** FAILURE *****")
|
|
||||||
print(f"Failures: {len(failures)}")
|
print(f"Failures: {len(failures)}")
|
||||||
for failure in failures:
|
for failure in failures:
|
||||||
print(failure)
|
print(failure)
|
||||||
|
|||||||
Reference in New Issue
Block a user