Fixes#25924.
The `snapToIntersection` function has been changed to an if-elif structure, and in case of face-edge intersection snap, only two sublements are checked. This ensures a reasonable speed, even if objects have many edges and faces. The change does mean you have to move the mouse over the correct face for it to be processed. But since face-edge intersection snap is new anyway, this is acceptable I think.
Used TestMach3Mach4LegacyPost.py as the starting point with input from
other test scripts too.
The test demonstrate a fix for #25723, as the Fanuc post processor has not been not updated to the latest changes in
the Path module.
This is related to #24676, where thread tapping was added to LinuxCNC, but the equivalent code in the Fanuc
postprocessor were not adjusted to cope, and #25677 where it was observed that the Fanuc postprocessor was
broken in versions 0.20 and 1.0.
Added MockTool class to provide ShapeName to fanuc_post.py, used to
convert drill cycles to threading cycles if the tool has shapeid "tap".
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.
* Part: TopoShape make getElementTypeAndIndex more robust
* Part: Add unit tests for new regex
---------
Co-authored-by: Chris Hennes <chennes@gmail.com>
* Gui: Fix preferences search popup positioning on Wayland
Change window flag from `Qt::Tool` to `Qt::ToolTip` to fix popup
appearing in center of screen and closing immediately on Wayland desktop
envs. `Qt::ToolTip` uses xdg_popup protocol which provides proper
positioning relative to parent window on Wayland.
* Gui: Initialize ok check flag to default in prefs
* Gui: Use ranged for loop where possible in prefs
* Gui: Remove unused variable in preferences controller
* Gui: Use const where possible in prefs search dialog
* Gui: Use static where possible in search prefs dialog
* Gui: Use braced initializer list when returning type in search prefs
* Gui: Use auto in search prefs dialog where possible
* Gui: Do not use else if after return in search prefs dialog
* [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>
* Match the string that gets sent to setCommand
Correction of a not matching string that gets sent to setCommand. This results in a not translated menu item in the Sketcher menu.
* [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>