Remove try except blocks, rename piecewise-step to function-step, remove settings where default suffices

This commit is contained in:
Dion Moult
2026-02-13 09:57:51 +11:00
parent cd6e531120
commit f06873d24e
2 changed files with 2 additions and 22 deletions
+1 -14
View File
@@ -306,14 +306,6 @@ class Alignment:
# This handles negative-length curve segments correctly at the C++ level
try:
s = ifcopenshell.geom.settings()
try:
s.set("piecewise-step-type", 0) # step-size is maximum step size
except RuntimeError:
pass
try:
s.set("piecewise-step-size", distance_interval)
except RuntimeError:
pass
shape = ifcopenshell.geom.create_shape(s, curve_segment)
verts = shape.verts
@@ -462,12 +454,7 @@ class Alignment:
return None
# Generate vertices using IfcOpenShell's geometry engine
try:
vertices = align_util.generate_vertices(rep_curve, distance_interval=1.0)
except (ValueError, NotImplementedError, RuntimeError) as e:
# RuntimeError can occur if IfcOpenShell version doesn't support certain settings
print(f"[Alignment] generate_vertices failed: {e}")
return None
vertices = align_util.generate_vertices(rep_curve, distance_interval=1.0)
if len(vertices) < 2:
print(f"[Alignment] Not enough vertices ({len(vertices)}), need at least 2")
@@ -100,14 +100,7 @@ def generate_vertices(rep_curve: entity_instance, distance_interval: float = 5.0
)
s = ifcopenshell.geom.settings()
try:
s.set("piecewise-step-type", 0) # 0 = step-size is maximum step size, 1 = step-size is mininimum number of steps
except RuntimeError:
print("[util.py] piecewise-step-type setting not available, skipping")
try:
s.set("piecewise-step-size", distance_interval)
except RuntimeError:
print("[util.py] piecewise-step-size setting not available, skipping")
s.set("function-step-param", distance_interval)
shape = ifcopenshell.geom.create_shape(s, rep_curve)
vertices = shape.verts
if len(vertices) == 0: