CAM: Convert tapping operation to experimental feature, Add tap pitch support, improve tapping logic, and update toolbit schema and legacy linuxcnc post

CAM/App/PathSegmentWalker.cpp
- Add G74 to drill/tap/bore G-code recognition for tapping cycles

CAM/InitGui.py
- Move CAM_Tapping command behind experimental feature flag
- Only group drilling/tapping commands if both are enabled

CAM/Path/Base/Generator/tapping.py
- Add pitch and spindle_speed parameters to tapping.generate
- Output S (spindle speed) and F (pitch) in generated G-code

CAM/Path/Op/Tapping.py
- Require Pitch property for tap tools and SpindleSpeed for tool controllers
- Pass pitch and spindle speed to tapping.generate
- Use SpindleDirection to determine right/left hand tap

CAM/Path/Post/scripts/linuxcnc_post.py
- Handle G84/G74 tapping cycles: convert pitch and spindle speed to feed rate
- Remove F and S from output and recalculate F as needed

CAM/Path/Tool/shape/models/tap.py
- Add Pitch property to ToolBitShapeTap schema
- CAM/Path/Tool/toolbit/models/tap.py
- Show pitch and rotation in tap tool summary
- Use is_imperial_pitch to format pitch as TPI or mm

CAM/Path/Tool/toolbit/util.py
- Add is_imperial_pitch utility to classify pitch as imperial or metric

CAM/Tools/Bit/375-16_Tap.fctb
- Remove unused parameters (Coating, Rotation, TPI, Type)
- Keep only relevant tap parameters for new schema
This commit is contained in:
Billy Huddleston
2025-09-22 16:28:45 -04:00
parent 39d39f34c3
commit cbeb67b509
10 changed files with 155 additions and 30 deletions

View File

@@ -38,7 +38,15 @@ else:
Path.Log.setLevel(Path.Log.Level.INFO, Path.Log.thisModule())
def generate(edge, dwelltime=0.0, repeat=1, retractheight=None, righthand=True):
def generate(
edge,
dwelltime=0.0,
repeat=1,
retractheight=None,
righthand=True,
pitch=None,
spindle_speed=None,
):
"""
Generates Gcode for tapping a single hole.
@@ -90,6 +98,8 @@ def generate(edge, dwelltime=0.0, repeat=1, retractheight=None, righthand=True):
cmdParams["Y"] = startPoint.y
cmdParams["Z"] = endPoint.z
cmdParams["R"] = retractheight if retractheight is not None else startPoint.z
cmdParams["S"] = spindle_speed if spindle_speed is not None else 1.0 # Sanity default
cmdParams["F"] = float(pitch) if pitch is not None else 100.0 # Sanity default
if repeat < 1:
raise ValueError("repeat must be 1 or greater")