I would like to dedicate this topic to the integration of 4th-axis into the Path Pocket Shape tool in the PathWB.
I have attached the two modified scripts; you need both. Place them in your FreeCAD/Mod/Path/PathScripts directory, AFTER renaming your originals for safe keeping. Rename the new scripts to the original script names. Restart FreeCAD and have fun. I do not know how far backwards compatibility will work. Use at your own risk.
There is an existing bug related to the Extension Corners feature. Selecting a face that requires rotation (4th-axis) will cause an error, removing an unacceptable face(s) from the new operation. Simply double click on the same operation, go to the Base Geometry tab in the task window for the operation, select the face, add it to the list, then click OK. This should give you the desired operation. You might have to repeat this process, or click the blue recompute icon.
I think, in order to correct the related error, we will also have to integrate the 4th-axis pre-rotation into the Extension Corners code sections.
There is a temporary property, "B_Axis Error Override," in the Path property section. Set to TRUE if you wish to align B-axis(Y-axis) rotations with the model for inspection purposes.
UPDATE: 2019-05-12 This will make these rotations look wrong in FC versions older than pre_0.19.16653 roughly, but will be correct in the real world. Versions released after PR #2114, roughly pre_0.19.16653, will render B-axis(Y-axis) rotations correctly with this property set to FALSE.
Regardless: Set "B_Axis Error Override" to FALSE before exporting gcode !
There is a "Reverse Direction" property in the Pocket property section. Should you need the pocket path orientation reversed (flipped 180 degrees), set this to TRUE. Hopefully this will yield the desired result.
Path Pocket Shape 4th-axis Usage:
To use the 4th-axis feature, do the following.
- Click on the Path Pocket Shape icon to start the operation.
- Click the OK to create the operation - no faces selected
- Select the new Pocket_Shape operation in task window
- In the operation's Properties list, scroll to Path section and change the "Enable Rotation" property to the desired 4th-axis setting.
- Re-compute the operation
- Double click on the same operation, to edit settings in the task window.
- Open the 'Base Geometry' tab. Select one face (preferred at the moment) and click the 'Add' button, placing that face in the Base Geometry list.
- Change the other operation settings as desired.
- Click OK to save and apply the changes.
I appreciate the help testing the code. Please post pics, source model files and FC info when posting feedback. This is looking better every time!
Thanks,
Russell
UPDATE: 2019-04-26 Version 1f_testing uploaded :: should respect XYZ linear Model translations in Job setup; added axis selection property
UPDATE: 2019-04-30 This topic is also related to PR #2114.
UPDATE: 2019-04-30 Updated scripts to Rev. 1h Testing. Same version as currently in the PR. Repaired broken Profile Faces and Mill Faces operations based upon PathAreaOp.py script. Also addressed depthparams issue detected by @Sliptonic via Mill Faces op.
UPDATE: 2019-05-06 Updated PathPocketShape.py script to Rev. 1i Testing. Thanks to @RatonLaveur for identifying broken multi-face selection in Geometry tab of operation settings. Now fixed. Issue remains with tool controller.
UPDATE: 2019-05-12 Updated both PathPocketShape.py and PathAreaOp.py scripts attached to versions just copied from FC master since being committed in PR #2114.
UPDATE: 2019-06-01 Updated both PathPocketShape.py and PathAreaOp.py scripts attached to version 1k-testing. Fix for random repositioning of job model. Now creates additional clone per axis_angle rotation for basis of rotational pockets, then destroys temp clone used. You will need to re-create Path_Shape operations because the "Use Rotation" property is renamed "Enable Rotation" to prepare for UI integration.
UPDATE: 2019-06-01 Updated both PathPocketShape.py and PathAreaOp.py scripts attached to version 1k-testing-patch. Cleaned up code a bit and adapted for more universal integration of 4th-axis into the PathWB.
UPDATE: 2019-06-11 Updated both PathPocketShape.py and PathAreaOp.py scripts attached to version 2f-testing. Simplified code related to 4th-axis. Fixed model repositioning issue. Same version as PR #2231.
UPDATE: 2019-06-13 Updated both PathPocketShape.py and PathAreaOp.py scripts attached to version 2g-testing. Made some fixes pointed out by the involved and active @RatonLaveur. Additional cleaning of code and other feature tweaks.
UPDATE: 2020-10-06
Since the last update above, there have been a few additional improvements and fixes to the PathPocketShape module pertaining to 4th-axis. The scripts mentioned in the intro above are removed from this post and the master branch contains the most current version of the PathPocketShape module as related to this particular thread.
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16886 (Git)
Build type: Release
Branch: master
Hash: ed47e962d2c821bf1792889f6d7bdf457dcf6c9e
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)