Перейти до основного вмісту

raygeo.ops.feature.ramp

Functions

find_ramp_carrier()

find_ramp_carrier(
boundary: Sequence[tuple[float, float]],
islands: Sequence[Sequence[tuple[float, float]]] | None = None,
tool_radius: float = 3,
max_ramp_angle_deg: float = 45,
) -> tuple[tuple[float, float], tuple[float, float]] | None

Find the longest straight carrier segment suitable for ramp entry.

Returns a ((x1, y1), (x2, y2)) tuple representing the longest straight-line segment within the valid tool-centre region (boundary eroded by tool_radius minus dilated islands) that is long enough for a ramp descent of one pass at the given maximum ramp angle.

The returned segment is oriented so the start point has the smaller coordinate on the dominant axis.

ParameterTypeDescription
boundarySequence[tuple[float, float]]Outer boundary polygon as [(x, y), ...].
islandsSequence[Sequence[tuple[float, float]]] | None = NoneList of island polygons (optional).
tool_radiusfloat = 3Tool radius in mm.
max_ramp_angle_degfloat = 45Maximum ramp angle in degrees.
Returnstuple[tuple[float, float], tuple[float, float]] | None((x1, y1), (x2, y2)) or None if no carrier found.

find_ramp_carrier on L-shaped, rectangle with blocking island, and T-shaped pocket.

find_ramp_carrier on L-shaped, rectangle with blocking island, and T-shaped pocket.