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

raygeo.cnc.machining.adaptive

Functions

build_clearing_workplan()

build_clearing_workplan(
pocket_boundary: Sequence[tuple[float, float]],
islands: Sequence[Sequence[tuple[float, float]]] | None = None,
tool_radius: float = 3,
step_over: float = 2,
step_length: float = 0.6,
target_z: float = -5,
safe_z: float = 2,
wall_margin: float = 0,
safe_margin: float = 1,
stock_to_leave: float = 0,
plunge_pitch: float = 1,
angular_step: float = 0.1,
area_tolerance: float = 1,
max_deflection_deg: float = 30,
finishing: bool = False,
) -> list[dict]

Build a clearing workplan for the given pocket.

Produces entry steps for the largest wide region, an AdaptiveClear step covering the whole pocket, narrow-passage-specific steps (ToroidalClear or Slot) for each classified passage, and an optional ProfileInner finishing pass.

Combine with raygeo.cnc.machining.plan.Workplan to turn the steps into a toolpath.

ParameterTypeDescription
pocket_boundarySequence[tuple[float, float]]Outer boundary as [(x, y), ...].
islandsSequence[Sequence[tuple[float, float]]] | None = NoneList of island polygons (default None).
tool_radiusfloat = 3Tool radius in mm (default 3.0).
step_overfloat = 2Radial step-over (default 2.0).
step_lengthfloat = 0.6Forward step length (default 0.6).
target_zfloat = -5Target cutting depth (default -5.0).
safe_zfloat = 2Safe Z height (default 2.0).
wall_marginfloat = 0Wall margin (default 0.0).
safe_marginfloat = 1Safety margin from tool edge (default 1.0).
stock_to_leavefloat = 0Stock to leave for finishing (default 0.0).
plunge_pitchfloat = 1Helix pitch per revolution (default 1.0).
angular_stepfloat = 0.1Angular step in radians (default 0.1).
area_tolerancefloat = 1Convergence area tolerance (default 1.0).
max_deflection_degfloat = 30Max deflection per step in degrees (default 30.0).
finishingbool = FalseWhether to add a ProfileInner finishing pass (default False).
Returnslist[dict]List of WorkplanStep dicts with a "kind" key.

Clearing workplan: narrow passage (ToroidalClear), slot (Slot), dual-entry dumbbell (Unreachable).

Clearing workplan: narrow passage (ToroidalClear), slot (Slot), dual-entry dumbbell (Unreachable).