Refactor routing internals and archive retry benchmarks
This commit is contained in:
parent
a8720ac8c9
commit
ea5cfe7f31
1 changed files with 3481 additions and 2583 deletions
14
inire/geometry/sbend.py
Normal file
14
inire/geometry/sbend.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
"""Exact S-bend dimensions for constructive planners."""
|
||||
|
||||
from math import isqrt
|
||||
|
||||
|
||||
def exact_sbend_spans(radius: int) -> dict[int, int]:
|
||||
"""Map lateral offsets to their positive integer spans for a fixed radius."""
|
||||
spans = {}
|
||||
for offset in range(1, 2 * radius):
|
||||
squared = offset * (4 * radius - offset)
|
||||
span = isqrt(squared)
|
||||
if span * span == squared:
|
||||
spans[offset] = span
|
||||
return spans
|
||||
Loading…
Reference in a new issue