fix: strip closing duplicate points in triangulation (segfault fix), batch line creation for NX speed, 6mm endmill params

This commit is contained in:
2026-02-16 19:29:41 +00:00
parent 61dcefb5ea
commit c93239c9c6
3 changed files with 34482 additions and 86728 deletions

View File

@@ -62,7 +62,12 @@ def build_pslg(geometry, params):
hole_markers = []
# Outer boundary (no offset needed — frame is handled in profile assembly)
outer = geometry['outer_boundary']
outer = list(geometry['outer_boundary'])
# Strip closing duplicate if last == first
if len(outer) > 2:
d = np.linalg.norm(np.array(outer[0]) - np.array(outer[-1]))
if d < 0.01:
outer = outer[:-1]
v_start = len(vertices)
vertices.extend(outer)
n = len(outer)
@@ -84,6 +89,11 @@ def build_pslg(geometry, params):
# Fallback for non-circular holes
keepout_boundary = offset_polygon(hole['boundary'], keepout_dist, inward=False)
# Strip closing duplicate if present
if len(keepout_boundary) > 2:
d = np.linalg.norm(np.array(keepout_boundary[0]) - np.array(keepout_boundary[-1]))
if d < 0.01:
keepout_boundary = keepout_boundary[:-1]
v_start = len(vertices)
vertices.extend(keepout_boundary)
n_h = len(keepout_boundary)