Commit Graph

681 Commits

Author SHA1 Message Date
sliptonic
a830278b86 Merge pull request #24676 from Connor9220/TappingWithAnnotations
CAM: Add rigid tapping support to linuxcnc_post.py via Annotations
2025-11-14 11:39:59 -06:00
sliptonic
c090bcaf43 Merge pull request #24675 from Connor9220/PathCommandAnnotations
CAM: Path command annotations
2025-11-14 11:39:31 -06:00
sliptonic
b9bba811dd Merge pull request #22764 from tarman3/postprocess
CAM: Post Process only selected Operations
2025-11-14 11:35:27 -06:00
tarman3
23ed2a2318 CAM: DressupArray - Fix python import 2025-11-14 00:11:44 +02:00
tarman3
a7f800ae82 CAM: Post Process only selected Operations 2025-11-13 23:25:53 +02:00
luzpaz
16fae1d739 Fix typos and grammar (#24827)
* Fix typos and grammar
Fixes typos and grammar in several files.

* fix missed typo

* Remove unnecessary line in LeadInOut.py

---------

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2025-11-13 19:53:35 +00:00
Marcell Pardavi
1005878163 CAM: Simulator — fix model centering when HiDPI scaling is active 2025-11-13 14:34:29 +01:00
github-actions
bb748b15ea Update translations from Crowdin 2025-11-11 23:44:18 -06:00
pre-commit-ci[bot]
9fe130cd73 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
Billy Huddleston
4794c44121 CAM: Fix ReferenceError when accessing deleted toolbit object
Prevent crash (CAMTests) in ToolBitRecomputeObserver when the toolbit object has been deleted/missing
by catching ReferenceError before accessing its Document attribute. This ensures slotRecomputedDocument
exits gracefully if the object is no longer valid.

src/Mod/CAM/Path/Tool/toolbit/models/base.py
- Wrapped access to self.toolbit_proxy.obj.Document in try/except to handle ReferenceError
if object is deleted/missing, preventing crash during document recompute.
2025-11-10 18:44:02 -06:00
Billy Huddleston
3740220568 CAM: Improve Z retract reliability in rotational scan after geometry recompute
Introduced FLOAT_EPSILON for robust floating point comparisons, resolving cases
where Z axis retract moves were missing after geometry recompute in 3D Surface
rotational scan operations. This prevents precision errors from causing the
cutter to skip intended lifts between rings or scan lines.

src/Mod/CAM/Path/Op/Surface.py
 - Added FLOAT_EPSILON constant
 - Updated Z move comparison logic to use tolerance
2025-11-10 10:45:58 -06:00
Billy Huddleston
f26f14b3ae CAM: Fix infinite recompute loop when ToolBit properties use expressions
A bug in the ToolBit model caused an infinite recompute loop and UI freeze when properties such as Diameter, Flutes, or CuttingEdgeHeight were set to expressions. The visual representation update was being triggered during document recompute, which could recursively trigger further recomputes. This fix defers visual updates by queuing them and processing only after the document recompute completes, using a document observer. The observer is cleaned up after use and on object deletion, preventing memory leaks and repeated recompute cycles.

src/Mod/CAM/Path/Tool/toolbit/models/base.py:
- ToolBitRecomputeObserver: Document observer class that triggers queued visual updates after recompute completes via slotRecomputedDocument.
- _queue_visual_update: Queues a visual update to be processed after document recompute.
- _setup_recompute_observer: Registers the document observer for recompute completion.
- _process_queued_visual_update: Processes the queued visual update and cleans up the observer.
- onChanged: Now queues visual updates instead of calling them directly.
- onDelete: Cleans up any pending document observer before object removal.
2025-11-10 10:43:15 -06:00
neurallambda
e755e41b51 Fix CAM job "no attribute Proxy" (#25034) 2025-11-10 10:42:32 -06:00
tarman3
ecc7b79749 CAM: Slot - Fix references enumeration 2025-11-10 10:41:58 -06:00
Billy Huddleston
cb3639e679 Add rigid tapping support to linuxcnc_post.py and annotate tapping commands in Tapping.py
- 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.
2025-11-10 02:48:27 -05:00
Florian Foinant-Willig
8d52043b04 OCC usage: fix deprecated Handle_* 2025-11-06 10:43:52 +01:00
sliptonic
c1c0be4409 Merge pull request #24732 from tarman3/dressup_icon
CAM: Fix Dressups icon Active state
2025-11-03 11:14:15 -06:00
pre-commit-ci[bot]
2c252d6ccf [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-10-31 21:06:39 +00:00
PhoneDroid
70acbc99c8 [ CAM ]: Update SPDX License Identifiers 2025-10-31 17:00:32 -04:00
sliptonic
0837114800 Merge pull request #24875 from tarman3/simsubmenu
CAM: Simulators - Drop down menu in toolbar
2025-10-31 11:11:34 -05:00
Billy Huddleston
db40eb1478 CAM: Fix expression editor so that widgets refresh after closing
src/Gui/QuantitySpinBox.cpp:
- Call updateExpression() after setExpression() in QuantitySpinBox

src/Gui/SpinBox.cpp:
- Call updateExpression() after setExpression() in ExpressionSpinBox

src/Gui/Widgets.cpp:
- Call onChange() after setExpression() in ExpLineEdit

src/Mod/CAM/Path/Base/Gui/Util.py:
- Connect to showFormulaDialog signal and refresh CAM QuantitySpinBox Python wrapper when dialog closes
2025-10-28 15:29:01 -05:00
github-actions
a3c2454a61 Update translations from Crowdin 2025-10-27 21:06:54 -05:00
tarman3
578d8cdd86 CAM: Fix Dressups icon Active state 2025-10-27 20:21:45 +02:00
sliptonic
4dfb20676a Merge pull request #24809 from sebastianohl/main
Zero-4 machine controller don't like two M-commands in one line
2025-10-27 12:11:27 -05:00
Billy Huddleston
b1437fe189 CAM: Refactor LeadInOut task panel to use QuantitySpinBox and improve migration/visibility logic
- Replace QDoubleSpinBox widgets with Gui::QuantitySpinBox in DressUpLeadInOutEdit.ui for all lead-in/out numeric fields, enabling unit/expressions support.
- Register QuantitySpinBox as a custom widget in the .ui file.
- Refactor TaskDressupLeadInOut panel setup:
  - Add setupSpinBoxes, setupGroupBoxes, setupDynamicVisibility for cleaner UI initialization.
  - Use PathGuiUtil.QuantitySpinBox for all numeric fields and ensure updateWidget() is called for each.
  - Centralize signal registration and field updates using getSignalsForUpdate and pageGetFields.
  - Move group box signal handler to a class method.
  - Share hideModes dictionary for field visibility logic.
  - Add dynamic label switching for "Radius"/"Length" with translation placeholders.
  - Remove the Include layers Check Box
- Improve ObjectDressup migration:
  - Use shared hideModes from TaskDressupLeadInOut.
  - Set default angles to 90 instead of 45.
  - Preserve previous style values when migrating StyleOn/StyleOff.
  - Ensure field visibility is updated after migration.
- Add Perpendicular and Tangent to lead_styles in correct order.
2025-10-27 12:10:06 -05:00
tarman3
5dbfb009a7 CAM: Simulator submenu in toolbar 2025-10-27 12:46:06 +02:00
tarman3
300ef6194c CAM: LeadInOut - Fix isActive() 2025-10-23 15:16:02 +03:00
Sebastian Ohl
7e6982e399 adding newline, as the Zero-4 machine controller don't like two M-commands in one line 2025-10-23 13:54:22 +02:00
tarman3
753ca9e04a CAM: LeadInOut - Fix LeadIn off 2025-10-23 06:48:14 +03:00
tarman3
1739ca4ac2 CAM: LeadInOut - Revert Perpendicular and Tangent styles 2025-10-22 20:22:49 +03:00
sliptonic
b125c221a6 Merge pull request #24433 from tarman3/leadinout_radius
CAM: LeadInOut - Radius and ToolController
2025-10-22 11:55:09 -05:00
github-actions
5ae4bbf837 Update translations from Crowdin 2025-10-20 09:57:05 -05:00
Chris Hennes
4200c43945 Merge pull request #24734 from Syres916/CAM_Fix_SetupSheet_Table_MinHeight
[Gui] fix Arch Grid QTableview height and buttons width...
2025-10-20 09:41:51 -05:00
Lawrence Woestman
43bfd04217 CAM: Incorporated the first round of feedback 2025-10-19 16:24:41 -07:00
Lawrence Woestman
ec9e95dfe3 CAM: Add proposed Epic for improving postprocessors 2025-10-19 15:19:57 -07:00
tarman3
48919e9d55 CAM: LeadInOut - Radius and ToolController 2025-10-18 18:37:37 +03:00
Syres916
b4e9aae047 Merge branch 'FreeCAD:main' into CAM_Fix_SetupSheet_Table_MinHeight 2025-10-18 11:27:03 +01:00
David Kaufman
dcca69383e fix bug opening job ui panel 2025-10-17 15:08:10 -04:00
sliptonic
ee42b453f6 remove old supplemental fixture 2025-10-17 12:10:22 -05:00
David Kaufman
0335d06311 [CAM] make the adaptive model aware feature optional (#24553)
* [CAM] make the adaptive model aware feature optional

* fix CAM tests

* placate github codql

* remove model-aware-only properties from the adaptive task ui panel
2025-10-17 10:42:15 -05:00
sliptonic
6abf3993b0 Merge pull request #24661 from tarman3/icon
CAM: Fix icon while changing Active state for class ObjectOp
2025-10-17 10:41:20 -05:00
sliptonic
4acd1e3b8e Merge pull request #24606 from tarman3/toggle
CAM: Toggle Operation improve
2025-10-17 10:41:00 -05:00
Billy Huddleston
58de49717f Promote embedded toolbits to correct shape type during migration
- Enhance _promote_toolbit to handle embedded toolbits that still have a "Custom" shape type.
- If ShapeType is "Custom" but ShapeID is present, attempt to promote to the correct shape class using ShapeID.
- Log promotion for traceability.
- This improves migration of legacy embedded toolbits and ensures proper shape assignment.
2025-10-15 18:04:40 -04:00
Billy Huddleston
5bc8fe2f74 CAM: Simplify annotation handling in GCode and improve annotation parsing
src/Mod/CAM/App/Command.cpp:
- Removed requirement for annotations= prefix; now all text after ; is treated as annotation data.
- Updated Command::toGCode to output annotations as key-value pairs in comments.
- Improved setFromGCode to extract annotations from any comment after ;.
- Enhanced annotation parsing to handle quoted strings and floating-point numbers.
- Simplified XML serialization and restoration logic for annotations.

src/Mod/CAM/App/Path.cpp:
- Added addCommandNoRecalc, allowing bulk loading of commands without repeated recalculation.
- Refactored RestoreDocFile to read GCode files line-by-line, parse each command, and call recalculate() only once after all commands are loaded.
- Added explanatory comment above the old implementation.

src/Mod/CAM/App/Path.h:
- Declared addCommandNoRecalc in the Toolpath class.

src/Mod/CAM/CAMTests/TestPathCommandAnnotations.py:
- Adjusted unit test for scientific notation annotation to check only 6 decimal places.
- Adjusted unit test 10 to properly handle assertions with the toGCode method

src/Mod/CAM/PathSimulator/AppGL/GCodeParser.cpp:
- GCodeParser::ParseLine: Truncate at first semicolon (annotations / comment)
2025-10-15 14:43:40 -04:00
Billy Huddleston
738107f3fb CAM: Enhance Path.Command annotations with variant type, type-safe API, and robust persistence
- Refactored `Annotations` member to use `std::variant<std::string, double>` for type-safe storage of both string and numeric values.
- Implemented C++ methods:
	- `setAnnotation(key, value)`: overloaded for string and double types.
	- `getAnnotation(key)`: returns annotation value as string.
	- `getAnnotationString(key)`: returns string annotation.
	- `getAnnotationDouble(key, fallback)`: returns numeric annotation.
	- `getAnnotationValue(key)`: returns raw variant value.
	- `hasAnnotation(key)`: checks for annotation existence.
	- `setAnnotations(annotationString)`: parses and stores values as double if possible, otherwise as string.
- Improved XML serialization (`Save`) and deserialization (`Restore`) to persist annotation types and values, including annotation count for robust restoration.
- Updated Python bindings:
	- `Annotations` property now supports mixed-type values (str/float).
	- Values are returned as native Python types.
	- Type errors are raised for invalid assignments.
- Expanded tests in `TestPathCommandAnnotations.py`:
	- Added cases for mixed-type annotations, edge cases, and in-memory persistence using `dumpContent`/`restoreContent`.
	- Verified type preservation and correct restoration.
- Ensured backward compatibility for string-only annotations and improved error handling.

**How to use annotations in Python:**

```import Path

c = Path.Command('G1', {'X': 10.0, 'Y': 20.0, 'F': 1000.0})
c.Annotations = {
	'tool_name': '6mm_endmill',      # string
	'spindle_speed': 12000.0,        # float
	'feed_rate': 1500,               # int (stored as float)
	'operation': 'pocket',           # string
	'depth_of_cut': -2.5,            # negative float
}
print(c.Annotations)  # {'tool_name': '6mm_endmill', 'spindle_speed': 12000.0, ...}
print(type(c.Annotations['spindle_speed']))  # <class 'float'>
print(type(c.Annotations['tool_name']))      # <class 'str'>

xml = c.dumpContent()
c2 = Path.Command()
c2.restoreContent(xml)
print(c2.Annotations)  # Restored with correct types

c.addAnnotations('speed:1000 operation:drill')
print(c.Annotations['speed'])        # 1000.0 (float)
print(c.Annotations['operation'])    # 'drill' (str)
```
2025-10-15 14:26:13 -04:00
tarman3
4c3f6fc21f CAM: Fix icon and Active state for class ObjectOp 2025-10-15 07:39:02 +03:00
Syres916
5327e827d0 Merge branch 'FreeCAD:main' into CAM_Fix_SetupSheet_Table_MinHeight 2025-10-12 18:38:46 +01:00
tarman3
e3edb725ea CAM: Toggle Operation improve 2025-10-12 15:22:35 +03:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ
c727846508 CAM: Remove UTF-8 coding declarations (#24527)
These declarations are no longer needed for Python 3+.
2025-10-09 13:49:18 -05:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ
ddfa7e6750 CAM: Updated SPDX License Identifiers (#24525) 2025-10-09 00:36:39 +00:00