生成无重叠的 0.2 mm Xynova 笔画图案

在打印页毫米坐标中筛选候选笔画,更新双 UV 产物。38 项测试通过;SVG 检查无交叠。
This commit is contained in:
ykcheungab
2026-10-05 14:56:34 +08:00
parent 0a3c3995f3
commit b2c39bd1b5
15 changed files with 34996 additions and 69989 deletions
+26
View File
@@ -0,0 +1,26 @@
"""Check laser-mark clearance in physical page coordinates."""
from __future__ import annotations
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "blender" / "scripts"))
from stroke_geometry import has_clearance # noqa: E402
def test_crossing_capsules_are_rejected() -> None:
existing = [((-0.2, 0), (0.2, 0), 0.1)]
assert not has_clearance(((0, -0.2), (0, 0.2), 0.1), existing, 0.03)
def test_near_parallel_capsules_need_edge_spacing() -> None:
existing = [((-0.2, 0), (0.2, 0), 0.1)]
assert not has_clearance(((-0.2, 0.22), (0.2, 0.22), 0.1), existing, 0.03)
assert has_clearance(((-0.2, 0.24), (0.2, 0.24), 0.1), existing, 0.03)
def test_disjoint_collinear_capsules_can_clear() -> None:
existing = [((0, 0), (0.2, 0), 0.1)]
assert has_clearance(((0.45, 0), (0.65, 0), 0.1), existing, 0.03)