मुख्य सामग्री पर जाएँ

raygeo.ops.assembly.profile

ProfileRampSpec​

Parameters for the profile ramp-entry assembler: it descends along the same loop the profile pass walks, so the tool enters the material gradually and the wall is never nicked by a vertical bore.

cut_direction​

cut_direction: str

"cw" or "ccw".

kind​

kind: str

"inner" or "outer".

ramp_angle​

ramp_angle: float

Steepest descent along the loop (radians).

stock_to_leave​

stock_to_leave: float

tolerance​

tolerance: float

Boundary-following tolerance of the loop derivation.

tool_radius​

tool_radius: float

wall_margin​

wall_margin: float

z_end​

z_end: float

z_start​

z_start: float

for_tool()​

for_tool(
kind: str,
tool_radius: float,
ramp_angle: float,
z_start: float,
z_end: float,
) -> ProfileRampSpec

A ramp spec with the neutral defaults for the per-operation fields; set wall_margin, stock_to_leave, cut_direction and tolerance on the result to match the ProfileSpec it leads into.

ParameterTypeDescription
kindstr"inner" or "outer".
tool_radiusfloatTool radius in mm.
ramp_anglefloatSteepest descent along the loop (radians).
z_startfloatHeight the ramp descends from.
z_endfloatDepth the ramp descends to.
ReturnsProfileRampSpec

ProfileSpec​

Parameters for the adaptive-profile assembler.

cut_direction​

cut_direction: str

"cw" or "ccw".

engagement_angle_threshold​

engagement_angle_threshold: float

engagement_area_threshold​

engagement_area_threshold: float

expansion_batch_size​

expansion_batch_size: int

feed_reduction_factor​

feed_reduction_factor: float

Factor (0–1) by which feed is reduced on over-engagement.

kind​

kind: str

"inner" or "outer".

safe_z​

safe_z: float

start_pos​

start_pos: Optional[tuple[float, float]]

Optional override start (x, y).

step_length​

step_length: float

step_over​

step_over: float

stock_to_leave​

stock_to_leave: float

target_z​

target_z: float

tolerance​

tolerance: float

tool_radius​

tool_radius: float

trace_path​

trace_path: Optional[str]

Optional path to write a binary trace file.

wall_margin​

wall_margin: float

for_tool()​

for_tool(
kind: str,
tool_radius: float,
target_z: float,
safe_z: float,
) -> ProfileSpec

A spec carrying the planner's canonical tuning for tool_radius: a radius-wide step-over, a fifth-of-a-radius step length, the clearing planner's engagement gates (a 1.0 mm² area gate, and a 30-rad angle gate that never trips, so feed reduction is area-driven) and its 0.5 feed-reduction factor. The per-operation fields keep their neutral defaults; set wall_margin, stock_to_leave, cut_direction, tolerance, start_pos and trace_path on the result.

ParameterTypeDescription
kindstr"inner" or "outer".
tool_radiusfloatTool radius in mm.
target_zfloatCutting depth (Z).
safe_zfloatSafe (rapid) Z height.
ReturnsProfileSpec

Functions​

profile_inner()​

profile_inner(
part: ops.part.Part,
tool_radius: float = 3,
step_over: float = 1.5,
step_length: float = 0.6,
target_z: float = -5,
safe_z: float = 2,
wall_margin: float = 0,
stock_to_leave: float = 0,
cut_feed_rate: int = 1000,
cut_power: float = 0,
start_pos: tuple[float, float] | None = None,
cut_direction: str = 'ccw',
engagement_area_threshold: float = 0,
engagement_angle_threshold: float = 3.141592653589793,
trace_path: str | None = None,
plunge_feed_rate: int | None = None,
) -> ops.assembly.AssemblyResult

Profile the inner boundary of a pocket, around islands.

Walks a tool around the inset boundary (offset inward by tool radius) and around accessible islands, so that the tool clears the material along the pocket walls and around each island. Returns an AssemblyResult with the profiling move sequence.

ParameterTypeDescription
partops.part.PartThe part whose cleared field tracks accumulated workpiece state and whose geometry defines the pocket boundary and islands.
tool_radiusfloat = 3Tool radius in mm.
step_overfloat = 1.5Radial step-over between passes (mm).
step_lengthfloat = 0.6Forward step length in mm.
target_zfloat = -5Cutting depth (Z).
safe_zfloat = 2Safe (rapid) Z height.
wall_marginfloat = 0Extra distance to keep from the wall (mm).
stock_to_leavefloat = 0Stock left on wall for rough pass (mm, default 0.0).
cut_feed_rateint = 1000Feed rate in mm/min.
cut_powerfloat = 0Spindle power (0.0–1.0).
start_postuple[float, float] | None = NoneOptional override start (x, y) (default: first boundary vertex).
cut_directionstr = 'ccw'"cw" or "ccw" (default "ccw").
engagement_area_thresholdfloat = 0Overengagement area threshold (mm², 0 = auto).
engagement_angle_thresholdfloat = 3.141592653589793Overengagement angle threshold (rad, default π).
trace_pathstr | None = NoneOptional path to write a binary trace file (default None).
plunge_feed_rateint | None = NoneVertical plunge feed in mm/min for the descent into material (default None: cut feed).
Returnsops.assembly.AssemblyResultAn AssemblyResult with the profiling path.

profile_inner on a square pocket with island — 2D: boundary, island, offset walks, cuts (turbo).

profile_inner on a square pocket with island — 2D: boundary, island, offset walks, cuts (turbo).

profile_inner with two accessible islands — nearest-neighbour order via turbo gradient.

profile_inner with two accessible islands — nearest-neighbour order via turbo gradient.

profile_inner on an L-shaped pocket with island — 3D: cut path at cut_z, rapids at safe_z.

profile_inner on an L-shaped pocket with island — 3D: cut path at cut_z, rapids at safe_z.

profile_inner skips an island when the channel between island and wall is too narrow.

profile_inner skips an island when the channel between island and wall is too narrow.

Two-pass inner profiling: rough (orange) + finish (red) on same ClearedArea.

Two-pass inner profiling: rough (orange) + finish (red) on same ClearedArea.

profile_inner on a curve-true circular boundary — the wall pass is emitted as true arcs.

profile_inner on a curve-true circular boundary — the wall pass is emitted as true arcs.

profile_outer()​

profile_outer(
part: ops.part.Part,
tool_radius: float,
step_over: float,
step_length: float,
target_z: float,
safe_z: float,
wall_margin: float,
cut_feed_rate: int,
cut_power: float,
start_pos: tuple[float, float] | None = None,
cut_direction: str = 'ccw',
stock_to_leave: float = 0,
engagement_area_threshold: float = 0,
engagement_angle_threshold: float = 3.141592653589793,
trace_path: str | None = None,
plunge_feed_rate: int | None = None,
) -> ops.assembly.AssemblyResult

Profile the outer boundary of a pocket.

Walks a tool around the grown boundary (offset outward by tool radius). The path stays approximately one tool radius outside the original boundary, removing any excess stock on the outer side. Returns an AssemblyResult with the profiling move sequence.

ParameterTypeDescription
partops.part.PartThe part whose cleared field tracks accumulated workpiece state and whose geometry defines the pocket boundary.
tool_radiusfloatTool radius in mm.
step_overfloatRadial step-over between passes (mm).
step_lengthfloatForward step length in mm.
target_zfloatCutting depth (Z).
safe_zfloatSafe (rapid) Z height.
wall_marginfloatExtra distance to keep from the wall (mm).
cut_feed_rateintFeed rate in mm/min.
cut_powerfloatSpindle power (0.0–1.0).
start_postuple[float, float] | None = NoneOptional override start (x, y) (default: first boundary vertex).
cut_directionstr = 'ccw'"cw" or "ccw" (default "ccw").
stock_to_leavefloat = 0Stock left on wall for rough pass (mm, default 0.0).
engagement_area_thresholdfloat = 0Overengagement area threshold (mm², 0 = auto).
engagement_angle_thresholdfloat = 3.141592653589793Overengagement angle threshold (rad, default π).
trace_pathstr | None = NoneOptional path to write a binary trace file (default None).
plunge_feed_rateint | None = NoneVertical plunge feed in mm/min for the descent into material (default None: cut feed).
Returnsops.assembly.AssemblyResultAn AssemblyResult with the profiling path.

profile_outer on a rect pocket — 3D (left) and 2D top-down with offset tool-centre polygon (right).

profile_outer on a rect pocket — 3D (left) and 2D top-down with offset tool-centre polygon (right).

profile_outer on a circular boundary — smooth walk around the offset circle.

profile_outer on a circular boundary — smooth walk around the offset circle.

profile_outer on an L-shaped pocket with miter join at the concave corner.

profile_outer on an L-shaped pocket with miter join at the concave corner.

Two-pass profiling: rough (with stock, orange) + finish (red) on the same ClearedArea.

Two-pass profiling: rough (with stock, orange) + finish (red) on the same ClearedArea.