Pular para o conteúdo principal

raygeo.cnc.machining.entry

Functions

adaptive_entry()

adaptive_entry(
pocket_boundary: Sequence[tuple[float, float]],
islands: Sequence[Sequence[tuple[float, float]]] = [],
tool_radius: float = 3,
step_over: float = 2,
safe_z: float = 2,
target_z: float = -5,
plunge_pitch: float = 1,
safe_margin: float = 1,
angular_step: float = 0.1,
cut_feed_rate: int = 1200,
cut_power: float = 1,
) -> ops.assembly.result.AssemblyResult

Fast central clearing entry.

Finds the optimal entry pole using find_largest_circle, then generates either a helix->spiral (wide area) or zigzag ramp (tight slot).

ParameterTypeDescription
pocket_boundarySequence[tuple[float, float]]Outer boundary of the pocket.
islandsSequence[Sequence[tuple[float, float]]] = []List of island (hole) polygons (default []).
tool_radiusfloat = 3Tool radius in mm (default 3.0).
step_overfloat = 2Radial step-over per spiral revolution (default 2.0).
safe_zfloat = 2Safe (retract) Z height (default 2.0).
target_zfloat = -5Target cutting depth (default -5.0).
plunge_pitchfloat = 1Vertical descent per helix revolution (default 1.0).
safe_marginfloat = 1Extra margin from tool edge to boundary (default 1.0).
angular_stepfloat = 0.1Angular step in radians for path vertices (default 0.1).
cut_feed_rateint = 1200Feed rate for the entry path (default 1200).
cut_powerfloat = 1Laser power for the entry path (0.0-1.0, default 1.0).
Returnsops.assembly.result.AssemblyResultAn AssemblyResult with the entry toolpath.

Adaptive clearing — Helix → Spiral in a pocket with three islands

Adaptive clearing — Helix → Spiral in a pocket with three islands

Adaptive clearing — Helix → Spiral in an L-shaped pocket

Adaptive clearing — Helix → Spiral in an L-shaped pocket

Adaptive clearing — ZigZag Ramp in a tight slot

Adaptive clearing — ZigZag Ramp in a tight slot

detect_entry_method()

detect_entry_method(
r_max: float,
tool_radius: float,
safe_margin: float = 0,
) -> str

Classify a pocket by its largest inscribed circle radius.

Returns "helix_spiral", "toroid", "ramp", or "none".

ParameterTypeDescription
r_maxfloatRadius of the largest inscribed circle (mm).
tool_radiusfloatTool radius (mm).
safe_marginfloat = 0Safety margin (mm, default 0).
ReturnsstrEntry method name.

generate_helix_spiral()

generate_helix_spiral(
entry_pt: tuple[float, float],
r_max: float,
tool_radius: float = 3,
step_over: float = 2,
safe_z: float = 2,
target_z: float = -5,
plunge_pitch: float = 1,
safe_margin: float = 1,
angular_step: float = 0.1,
state: ops.state.State | None = None,
) -> ops.assembly.result.AssemblyResult

Build a helix→spiral entry sequence.

Chains a helical plunge with a flat Archimedean spiral + smoothing circular pass. Useful when you already know the entry point and max radius (e.g. from find_largest_circle).

ParameterTypeDescription
entry_pttuple[float, float](x, y) entry point (pocket center).
r_maxfloatMax inscribed circle radius (mm).
tool_radiusfloat = 3Tool radius in mm (default 3.0).
step_overfloat = 2Radial step-over per spiral revolution (default 2.0).
safe_zfloat = 2Safe (retract) Z height (default 2.0).
target_zfloat = -5Target cutting depth (default -5.0).
plunge_pitchfloat = 1Vertical descent per helix revolution (default 1.0).
safe_marginfloat = 1Extra margin from tool edge to boundary (default 1.0).
angular_stepfloat = 0.1Angular step in radians (default 0.1).
stateops.state.State | None = NoneOptional machine state to apply before the path.
Returnsops.assembly.result.AssemblyResultAn AssemblyResult.

Helix → Spiral: helical plunge then Archimedean spiral

Helix → Spiral: helical plunge then Archimedean spiral