Skip to main content

raygeo.cnc.plan.profile

CNC profile plan builder.

Produces a one-step ~raygeo.cnc.plan.Plan that profiles the face boundary: the inset (inner) or grown (outer) offset, walked once at the target depth.

Functions​

plan_profile()​

plan_profile(
part: ops.part.Part,
face_id: str = '',
side: str = 'inner',
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,
stock_to_leave: float = 0,
cut_direction: str = 'ccw',
ramp_angle_deg: float = 0,
tolerance: float = 0.1,
feed_rate: Optional[float] = None,
plunge_feed: Optional[float] = None,
) -> cnc.plan.Plan

Build a plan that profiles a face boundary. The step walks the inset boundary (side "inner", the pocket side) or the grown boundary (side "outer", around the part) once at the target depth, honouring islands on the inner side. Curve-true face geometry is followed exactly, with arcs emitted as arcs; polygon-only parts take the chord path.

With ramp_angle_deg above 0 and curve-true face geometry, the plan prepends a ramp-entry step that descends along the profile loop at that angle, so the tool enters the material gradually instead of plunging.

ParameterTypeDescription
partops.part.Partpart whose face is profiled.
face_idstr = ''face to profile ("" is the default face).
sidestr = 'inner'"inner" or "outer".
tool_radiusfloat = 3tool radius (mm).
step_overfloat = 2radial step-over between passes (mm); at most the tool diameter.
step_lengthfloat = 0.6forward step length (mm).
target_zfloat = -5cutting depth (mm).
safe_zfloat = 2safe rapid height (mm).
wall_marginfloat = 0extra distance to keep from the wall (mm).
stock_to_leavefloat = 0stock left on the wall (mm).
cut_directionstr = 'ccw'"ccw" (wall on the left, climb for a clockwise spindle) or "cw".
ramp_angle_degfloat = 0steepest entry descent along the loop (degrees); 0 plunges straight down.
tolerancefloat = 0.1boundary-following tolerance (mm).
feed_rateOptional[float] = Nonecut feed (mm/min); None leaves the plan's cut state unset.
plunge_feedOptional[float] = Nonevertical plunge feed (mm/min); None falls back to the cut feed.
Returnscnc.plan.Planthe profile plan.

Profile workplan: one exact inner contour step on a circular part, cut in true arcs.

Profile workplan: one exact inner contour step on a circular part, cut in true arcs.

Profile workplan with a ramp entry: the tool descends along the loop before the wall pass.

Profile workplan with a ramp entry: the tool descends along the loop before the wall pass.