raygeo.ops.cut.interp
Interpolation
Bracket of error values for adaptive-stepping interpolation.
Maintains a min/max bracket around the target cut-area per distance and linearly interpolates to find the steering angle that achieves it.
add()
add(error: float, angle: float, pos: tuple[float, float]) -> None
Add a new sample to the bracket.
Maintains the invariant min.error <= max.error and keeps samples closest to zero on each side of
the root.
| Parameter | Type | Description |
|---|---|---|
error | float | |
angle | float | |
pos | tuple[float, float] | |
| Returns | None |
clamp_angle()
clamp_angle(angle: float, max_deflection: float) -> float
Clamp angle to ±max_deflection.
| Parameter | Type | Description |
|---|---|---|
angle | float | |
max_deflection | float | |
| Returns | float |
has_pos()
has_pos(pos: tuple[float, float]) -> bool
Whether either endpoint was sampled at pos.
| Parameter | Type | Description |
|---|---|---|
pos | tuple[float, float] | |
| Returns | bool |
interpolate()
interpolate() -> float
Linearly interpolate between min and max to find the angle where error = 0, clamped to [0.2, 0.8] in parameter space.
| Parameter | Type | Description |
|---|---|---|
| Returns | float |

Interpolation bracket: error vs steering with min/max samples (red/green) and zero-crossing (purple)
joint_is_valid()
joint_is_valid() -> bool
Whether a valid bracket around the root exists (min.error < 0 <= max.error).
| Parameter | Type | Description |
|---|---|---|
| Returns | bool |
max_angle()
max_angle() -> float
Maximum steering angle: +π/4.
| Parameter | Type | Description |
|---|---|---|
| Returns | float |
min_angle()
min_angle() -> float
Minimum steering angle: -π/4.
| Parameter | Type | Description |
|---|---|---|
| Returns | float |
Functions
point_in_valid_area()
point_in_valid_area(
pt: tuple[float, float],
area: Sequence[Sequence[tuple[float, float]]],
) -> bool
Check whether pt lies in a valid tool area defined by polygon shells and holes.
CCW-wound polygons are outer shells; CW-wound polygons are holes. A point is valid iff it is inside at least one CCW polygon AND outside all CW polygons.
| Parameter | Type | Description |
|---|---|---|
pt | tuple[float, float] | Query point (x, y). |
area | Sequence[Sequence[tuple[float, float]]] | List of polygon rings (each a list of (x, y) tuples). |
| Returns | bool | True if the point is in a valid region. |

Valid-area polygon: CCW shell (blue), CW hole (red dashed); points valid (green) or invalid (red)
rotate()
rotate(v: tuple[float, float], angle: float) -> tuple[float, float]
Rotate a 2D vector by angle radians.
| Parameter | Type | Description |
|---|---|---|
v | tuple[float, float] | Vector (x, y). |
angle | float | Rotation angle in radians. |
| Returns | tuple[float, float] | Rotated vector (x', y'). |

Rotation of a unit vector by various angles using :func:~raygeo.ops.cut.interp.rotate.