Skip to main content

raygeo.cnc.plan.tapping

CNC rigid-tapping plan builder.

Produces a plan that rigid-taps internal threads: one spindle- synchronized cycle per pilot bore, all sharing the same thread parameters. Bores come either from an explicit center list or are detected automatically as circular island contours of the face and validated against the thread geometry. Tapping feeds derive from the thread itself — every synchronized move travels pitch * rpm mm/min — so the spindle speed is mandatory.

Functions​

plan_tapping()​

plan_tapping(
part: ops.part.Part,
face_id: str = '',
nominal_diameter: float = 6,
pitch: float = 1,
target_z: float = -12,
z_surface: float = 0,
rapid_z: float = 1,
safe_z: float = 5,
handedness: str = 'rh',
peck: Optional[float] = None,
dwell_ms: float = 0,
spindle_rpm: Optional[int] = None,
coolant: Optional[str] = None,
holes: Optional[Sequence[tuple[float, float]]] = None,
hole_tolerance: float = 0.1,
hole_order: str = 'detection',
) -> cnc.plan.Plan

Build a plan that rigid-taps internal threads on one face.

One spindle-synchronized cycle per pilot bore; all bores share the thread parameters. Bores come from holes when given (explicit centers), otherwise they are detected as circular island contours of the face and validated: a bore at or above the nominal diameter has nothing left to tap. The synchronized moves travel pitch * spindle_rpm mm/min, so spindle_rpm is mandatory. Bores needing different parameters need a separate call.

ParameterTypeDescription
partops.part.Partpart whose face is tapped.
face_idstr = ''face to tap ("" is the default face).
nominal_diameterfloat = 6nominal (major) thread diameter (mm).
pitchfloat = 1thread pitch (lead) (mm).
target_zfloat = -12depth of the thread (default -12).
z_surfacefloat = 0surface Z the holes start at (default 0).
rapid_zfloat = 1rapid plane above the surface (default 1).
safe_zfloat = 5safe rapid height (default 5).
handednessstr = 'rh'"rh" (default) or "lh".
peckOptional[float] = Noneoptional peck increment; full synchronized retract between pecks (default None).
dwell_msfloat = 0dwell at the bottom before the spindle reversal (default 0).
spindle_rpmOptional[int] = Nonespindle speed (rpm); required.
coolantOptional[str] = None"flood", "mist" or "off"; None leaves the plan's coolant unset.
holesOptional[Sequence[tuple[float, float]]] = Noneexplicit pilot-bore centers [(x, y), ...]; None detects circular islands on the face.
hole_tolerancefloat = 0.1max distance (mm) between an island contour sample and the fitted circle for it to count as a bore (default 0.1).
hole_orderstr = 'detection'"detection" or "nearest_neighbor".
Returnscnc.plan.Planthe tapping plan, one step per bore.