跳转到主要内容

raygeo.ops.assembly.adaptive

Functions

adaptive_clearing()

adaptive_clearing(
cleared: ops.cut.cleared_area.ClearedArea,
pocket_boundary: Sequence[tuple[float, float]],
islands: Sequence[Sequence[tuple[float, float]]] = [],
radius: float = 3,
advance: float = 1.5,
cut_z: float = -5,
safe_z: float = 2,
step_length: float = 0.6,
max_deflection_deg: float = 30,
wall_margin: float = 0,
area_tolerance: float = 1,
cut_feed_rate: int = 1200,
cut_power: float = 1,
start_pos: tuple[float, float] | None = None,
start_heading: float | None = None,
expansion_batch_size: int = 20,
profile: bool = False,
) -> ops.Ops

Run forward-stepping adaptive clearing.

Starting from the pre-populated cleared area, uses a constant-engagement stepping solver to generate a continuous spiral toolpath from the seed clearing to the pocket wall.

The caller is responsible for populating cleared with entry polygons (e.g. from adaptive_entry) and prepending the entry Ops to the result.

ParameterTypeDescription
clearedops.cut.cleared_area.ClearedAreaClearedArea instance (mutated in place).
pocket_boundarySequence[tuple[float, float]]Outer boundary of the pocket.
islandsSequence[Sequence[tuple[float, float]]] = []List of island (hole) polygons (default []).
radiusfloat = 3Tool radius in mm (default 3.0).
advancefloat = 1.5Forward advance per step (default 1.5).
cut_zfloat = -5Cutting Z height (default -5.0).
safe_zfloat = 2Retract Z height for travel (default 2.0).
step_lengthfloat = 0.6Forward distance per solver step (default 0.6).
max_deflection_degfloat = 30Maximum steering deflection per step in degrees (default 30).
wall_marginfloat = 0Extra clearance between tool and boundary (default 0.0).
area_tolerancefloat = 1Stop when remaining uncut area drops below this threshold (default 1.0).
cut_feed_rateint = 1200Feed rate for cutting moves (default 1200).
cut_powerfloat = 1Laser power for cutting moves (0.0-1.0, default 1.0).
start_postuple[float, float] | None = NoneInitial tool position (x, y). When None, auto-detected from the cleared-area frontier.
start_headingfloat | None = NoneInitial tool heading in radians. When None, auto-detected as the CCW tangent at start_pos.
expansion_batch_sizeint = 20Batch cleared-area expansions every N steps (default 20). Larger values improve performance but may slightly reduce path quality.
profilebool = FalsePrint a profiling report to stdout (default False).
Returnsops.OpsOps with cutting commands (entry not included).

Forward-stepping constant-engagement clearing cuts (coloured by progress via the full-spectrum turbo gradient) from a central seed clearing (green), with MAT-routed travel links (red dashed) between segments.

Forward-stepping constant-engagement clearing cuts (coloured by progress via the full-spectrum turbo gradient) from a central seed clearing (green), with MAT-routed travel links (red dashed) between segments.

target_area_per_distance()

target_area_per_distance(
radius: float,
advance: float,
step_length: float,
) -> float

Target cut-area per unit distance for the engagement solver.

ParameterTypeDescription
radiusfloatTool radius in mm.
advancefloatStep-over distance in mm.
step_lengthfloatForward step length in mm.
ReturnsfloatTarget area per distance (mm).

Left: target area per distance as a function of advance for several step lengths. Right: target area per distance as a function of step length for several advance values.

Left: target area per distance as a function of advance for several step lengths. Right: target area per distance as a function of step length for several advance values.

Geometric model underlying : two disks offset by  along the travel direction, with a vertical wall at  representing the previous pass boundary. The fresh material (dark red) is the portion of the crescent that lies to the right of the wall.

Geometric model underlying target_area_per_distance: two disks offset by step_length along the travel direction, with a vertical wall at x = R − advance representing the previous pass boundary. The fresh material (dark red) is the portion of the crescent that lies to the right of the wall.