Make sure to use the active default values for preamble and postamble in the help text,
and provide the current default values as the default in the add_argument().
The only exception is uccnc_post.py, where the real default value depend on the use of
--no-comments, and sending the default argument to add_argument() would change behaviour.
This change was inspired by the changes done to fix (#20792) in
d84d9c9bd1.
* CAM: Dropped trailing percent from fanuc post processor output.
A trailing percent cause one Fanuc controller to hang when the program
is completed when drip feeding G code, and the minicom ascii upload
was unable to complete the upload.
Had to use emergecy stop to get the machine out of the hang.
* CAM: Adjust Fanuc post processor test to no longer expect trailing percent.
Several methods introduced 2025-05-04 are preferred, but the methods
available in version 1.0 are used as fallback sources
for active status and coolent enabled.
The difference according to the documentation is that M30 will rewind
the paper tape while M2 will not. The effect on a CNC from 1994 is
that M30 turn on the indicator light marking that the program has
completed, while M2 do not, and the light is wanted to know when
the machine is done.
Fanuc only understand upper case letters, no point in providing the
file name in lower case letters. The provided file name is always "-",
so drop it completely. The first comment is presented in the Fanuc user
interface, it should get more relevant content.
Dropped useless semicolon.
Enabling tool height compensation will cause the axis to move up
the length of the tool, which will cause a Z overtravel error when
the tool change take place close to the top of the machine. To
counter this move, ask the machine to move its commanded position
down the length of the tool height, which in effect causes no upward
movement after the tool change. The #4120 variable contain the
current tool number, and #2000 - #20XX contain the tool heights.
The Fanuc post processor add a trailing space to all M6 lines.
This make it problematic to write test for the generated output,
when compiled with the automatic policy enforcer on github
removing trialing space from the expected output. Avoid the
problem by removing the trailing space from the generated
output.
The thread tapping implementation in the Fanuc post processor change
behaviour of M3, G81 and G82 when the tool ShapeID matches "tap".
but the code not not expect that the parse() method will be
called with two different classes as arguments.
Rewrite the M3 handling to handle ToolController arguments
instead of crashing with an AttributeError.
Issues:
Fixes#14016Fixes#25723
Some Fanuc machines do not understand the 'M6 T0' instructions in the
preamble. Move it out of the preamble and controlled by a new
command line argument --no-end-spindle-empty for the machines
where running to cause a "Tool Number Alarm" and the program to crash
as tool zero is not a valid tool.
Fixes: #25677
Reset line number when using --line-numbers. Restore all default values when a
command line argument is not used.
This helps the test scripts ensure that the arguments passed during one test is the only
one taking effect during this test.
This PR adds rigid tapping back to the legacy LinuxCNC postprocessor, which
was removed in commit cd1c29e3f23fde0a90980ffcf3e70406769f2d43 in PR 24771.
The changes include:
- Modifying the linuxcnc_legacy_post.py script to include logic for Rigid tapping
- Updating comments and documentation to reflect the addition of Rigid tapping
* Post Processor cleanup and rename
remove unused files
Basic implementation of generic post
add blending mode support for linuxcnc
add mocking for postprocessor tests
Add tests for generic post
linuxcnc test only tests linuxcnc specific functionality
minor improvements
add arc splitting to refactored post processors
Refactor smoothie post
move posts to legacy. Remove 'refactored'
lint cleanup
fixes#19417
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Added --rigid-tap argument to linuxcnc_post.py to enable G33.1 rigid tapping cycle output.
- Implemented logic to skip G80, G98, G99 commands with tapping annotation when rigid tapping is enabled.
- Enhanced handling of G84/G74 tapping cycles for rigid tapping, including pitch (K), depth (Z), dwell (G04 P), spindle reversal (M3/M4/M5), and reverse-out moves.
- Updated Tapping.py to annotate G98/G99 and G80 commands with {"operation": "tapping"} for improved post processor handling.
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
* CAM: correct grbl_post retract heights
Some small corrections to retraction heights in expansion of G8x drilling cycles for GRBL machines.
Add comment blocks from NIST definitions to aid maintenance and understanding.
Rename some variables for clarity and ease of future maintenance.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* correct typo which prevented final retract move
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* CAM: revert grbl_post regression
I recently noticed a bug in grbl_proc post processor where it was not correctly setting OLD_Z if current machine_z is below G81 retract plane in R parmeter.
On digging into my original commit is looks like the two lines which did this have been commented out.
I can never find the Blame feature when I need so if someone else can find the culprit feel free.
2bd617a2b3
This PR simply reinstates the missing lines and adds a snippet of NIST as a comment block to prevent any over-zealous editing in the future.
This regression means that drilling cycles start with z=clearance height instead of z=safe height leading to much costly air cutting.
This similarly messes up the the retract plane for G98 leading to excessive machine time wasting and incorrect application of G98 returns.
Indeed this regression was noticed because some were claiming the Safe height was redundant in drilling ops since it was never used.
There is much discussion about all this at the moment which is being disrupted by people assuming the current broken paths are what FreeCAD is intended to do.
Let's fix this ASAP, so we can stop this confusion and get discussions back to reality.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Ondsel SVG post processor
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update src/Mod/CAM/Path/Post/scripts/svg_post.py
* Update src/Mod/CAM/Path/Post/scripts/svg_post.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>