Greetings FreeCAD users.
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 propertyUPDATE: 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.

I opened your file. I found a part of the problem in the job setup. The paths you see are based on the Body object, not the Model object. I don't know if this is related to the code modifications or was pre-existing. I recall a similar issue existing with the 3D Surface operation. I'm short on time, but I'll get back to you.

If you toggle visibility of the Body to on, and the Model in the Job to off, you will see two of the three operations align to the Body object. The top pocket needs "Reverse Direction" flag set to TRUE in the properties.

mfg
Russell

Last edited by Russ4262 on Wed Apr 24, 2019 7:14 pm, edited 1 time in total.

Hi, I really enjoy reading your posts, to the point that I am starting to be concerned for my F5 key. thanks a bunch for the work you are doing!. Looking forward to a time where I can revive my china 6040 4 axis and have a play with this. For the time being it feels like, all I have time to play with is diapers

Evening,
I have investigated the problem of the paths not aligning to the Model. It is within the new, modified code. I have to apply the translational adjustments of the Model in the Job setup into the rotational translations for the pockets. This is a little challenging...

great work!
I'm thinking about building a new (a bit bigger) CNC router since a while, - it seams it has to have 4 axis (at least).

Dos this working without OpenCamLib? because i still have probs to get it run...

Thanks, Herbk.
I don't think that OCL is required; however, when I attempt to load the PathWB without OCL, I receive an error and the tools do not load. It appears there is a dependency error thrown for PathWB in general if OCL is unavailable. I'll try to run more tests and investigate further.