将 Xynova 笔画延长至 50% 黑色覆盖率

沿现有笔画向空白处增长,保留最小线宽和笔画间隙。41 项测试通过,双 UV 矢量图无重叠。
This commit is contained in:
ykcheungab
2026-10-05 15:56:01 +08:00
parent b2c39bd1b5
commit f81418c542
14 changed files with 57264 additions and 57148 deletions
+4 -2
View File
@@ -36,10 +36,12 @@ def capsule_segment(cx, cy, half_length, angle):
return (cx - dx, cy - dy), (cx + dx, cy + dy)
def has_clearance(candidate, accepted, clearance):
def has_clearance(candidate, accepted, clearance, skip_index=None):
"""Capsules are (start, end, radius), all in the same physical units."""
start, end, radius = candidate
for other_start, other_end, other_radius in accepted:
for index, (other_start, other_end, other_radius) in enumerate(accepted):
if index == skip_index:
continue
limit = radius + other_radius + clearance
if (max(start[0], end[0]) + limit < min(other_start[0], other_end[0])
or max(other_start[0], other_end[0]) + limit < min(start[0], end[0])