将 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
+9
View File
@@ -24,3 +24,12 @@ def test_near_parallel_capsules_need_edge_spacing() -> None:
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)
def test_extension_ignores_only_its_original_capsule() -> None:
original = ((0, 0), (0.2, 0), 0.1)
neighbour = ((0.6, 0), (0.8, 0), 0.1)
assert has_clearance(((-0.1, 0), (0.3, 0), 0.1), [original, neighbour], 0.03,
skip_index=0)
assert not has_clearance(((-0.1, 0), (0.4, 0), 0.1), [original, neighbour], 0.03,
skip_index=0)
+4 -1
View File
@@ -116,6 +116,8 @@ def test_boolean_is_not_a_number() -> None:
("neighbourhood_mm", 0.0, "must be > 0"),
("clearance_mm", -0.01, "must be >= 0"),
("candidate_count", 0, "must be >= 1"),
("target_coverage", -0.01, "within [0, 1)"),
("target_coverage", 1.0, "within [0, 1)"),
],
)
def test_range_rules(key: str, value, expected: str) -> None:
@@ -184,5 +186,6 @@ def test_shipped_revisions_declare_the_expected_block(sensor: str) -> None:
resolved = stroke_pattern.resolve_stroke_settings(block)
expected = dict(stroke_pattern.STROKE_DEFAULTS)
if sensor == "finger-xynova":
expected.update(width_min_mm=0.20, clearance_mm=0.03, candidate_count=12)
expected.update(width_min_mm=0.20, clearance_mm=0.03, candidate_count=12,
target_coverage=0.50)
assert resolved == expected