Aller au contenu principal

raygeo.geo.algo.ramp

Ramp entry path generation for milling.

Provides linear and zig-zag ramp generation for tool entry into material, with automatic extension when the ramp angle exceeds the maximum.

RampStyle

Functions

generate_ramp()

generate_ramp(
start: tuple[float, float],
end: tuple[float, float],
z_start: float,
z_end: float,
max_ramp_angle_deg: float = 45,
style: RampStyle = RampStyle.Linear,
lateral_amplitude: float = 1,
) -> list[tuple[float, float, float]]

Generate a ramp entry polyline.

If the direct ramp angle exceeds max_ramp_angle_deg, the ramp is extended in both directions along the same line.

ParameterTypeDescription
starttuple[float, float]Start XY position.
endtuple[float, float]End XY position.
z_startfloatStarting Z height.
z_endfloatEnding Z height (must be lower than z_start).
max_ramp_angle_degfloat = 45Maximum allowed ramp angle in degrees (default 45).
styleRampStyle = RampStyle.LinearRamp style — Linear or ZigZag (default Linear).
lateral_amplitudefloat = 1Lateral oscillation amplitude for ZigZag (default 1.0).
Returnslist[tuple[float, float, float]]List of (x, y, z) points along the ramp.
ComplexityO(n) time, O(n) space where n is proportional to path length

Linear (left) and ZigZag (right) ramp entry paths

Linear (left) and ZigZag (right) ramp entry paths