This PR allows each Toolbit to have its own Units property (Metric/Imperial) for better unit management.
Short Summary:
- Adds a Units property (Metric/Imperial) to ToolBit objects for better unit management.
- Ensures ToolBit schema is set and restored properly in the editor and utilities.
- Updates formatting and property handling to respect the selected units.
- Improves the ToolBit editor widget to refresh and sync schema/UI when units change.
- Uses FreeCAD.Units.setSchema and getSchema to switch between unit schemas.
NOTE: Toolbit dimensions are read from JSON in their native units (as specified by the Units property),
converted to metric for all internal calculations, and displayed in the UI using the
toolbit's selected units. This ensures both accurate internal computation and user-friendly
display, while storing the correct units in the JSON. This can cause some rounding differences
when switching units. Example: 2 mm becomes 0.0787 inches. If you save that as imperial and then
switch back to metric, it will show 1.9999 mm
src/Mod/CAM/Path/Tool/toolbit/models/base.py:
- Add Units property to ToolBit and ensure it's set and synced with toolbit shape parameters.
- Update property creation and value formatting to use Units.
src/Mod/CAM/Path/Tool/toolbit/ui/editor.py:
- Use setToolBitSchema to set schema based on toolbit units.
- Add logic to refresh property editor widget when units change.
- Restore original schema on close.
- Improve docstrings and signal handling.
src/Mod/CAM/Path/Tool/toolbit/util.py:
- Add setToolBitSchema function for robust schema switching.
- Update format_value to use schema and units.
- Add docstrings and clarify formatting logic.
src/Mod/CAM/Path/Tool/library/ui/browser.py:
- Restore original schema after editing toolbit.
src/Mod/CAM/Path/Tool/library/ui/editor.py:
- Ensure correct schema is set for new toolbits.
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
Fix issue with toolshapes
Renamed fillet to radius
Added Tool Type Filter to library
Fix units so that they honor user preference
Remove the QToolBox widget from the Shape Selector page and combine into a single page.
Fix issue with PropertyBag so that CustomPropertyGroups as a string is converted to enum and enums are handled correctly.
Update TestPathPropertyBag test for enum changes.
Update TestPathToolBitListWidget
Update TestPathToolLibrarySerializer to match new LinuxCNC output
Fix LinuxCNC export too handle ALL tool types, use user preferences for units, and include all lcnc fields
CAM: Add copy/paste support for the ToolBitBrowser
CAM: Move library dropdown and sort order combo to dedicated row to give them more space
CAM: Fix: PathAssetManagerTest failed
CAM: Add YamlSerializer
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
CAM: Fix CodeQL complaints
CAM: add LibraryProperties dialog
CAM: Replace the LibraryEditor
CAM: allow for editing tool number in the tool editor dialog
CAM: Remember last selected library and sort order in preferences
CAM: support natural sort order in tool and library lists
CAM: Fix CodeQL complaints
CAM: Fix: not all attributes included in YAML serialization
CAM: Fix: UTF8 chars not included in LinuxCNC export
Fix: tool library not displayed when loading it for the first time
CAM: Fix: custom shape class not found
CAM: Check dependencies on import for friendlier error messages
CAM: Open file dialogs in home by default
CAM: Show "All Tools" entry in library list in the library editor
CAM: fix: error on sorting tools with no tool number
CAM: Fix: traceback if library contained tool number as string
CAM: Fix: Linter errors in manager.py
CAM: Fix: separator between library and tool buttons
CAM: Add drag & drop support to the library editor
CAM: Fix numerous linter errors on the AssetManager
CAM: Show current library in library editor window title
CAM: Add dedicated icons for library add + remove
CAM: Support F2 key in library editor
CAM: library editor handles delete key when library list is in focus; focus search field by default
CAM: fix: tool list in dock initially not loading
CAM: Fix: library editor did not open from "all tools" list
CAM: Increase precision of parameters in tool summary to 3 digits
fix TestToolBitListWidget