Hi,
I have followed FreeCAD for a while, and the Path workbench is interesting to me to generate tool paths which are kind to the cutters and machine., i.e. no plunges and no full width cutter paths. Mainly for small, (less than 3mm) cutters which can be a bit fragile and have a wont to break very easily.
Four firsts here for me, programming python in anger, open casade, voronoi library along with the diagrams and their pitfalls(mainly regular polygons and edge combinations which would form part of a regular polygon, and of course the FreeCAD object model.
Here is a screen shot of the medial axis path I have currently working(sort of, it still has bugs
, along with a generated gcode file, and the two source files which make this. The component is called a FacePocket, as a face is currently the only selection item to generate the path. It only generates one Z level at the moment as I am more interested in getting the path correct before moving on and I have not implemented Climb v Conventional as yet. It still requires 1/2 toolwidth + material allowance offsetting of course, but that has not been done so I can test for intrusions of the toolpath into the model.
In InitGui.py Initialize add
from PathScripts import PathFacePocket
You will need to compile and install the open voronoi source from https://github.com/aewallin/openvoronoi
ToDo
1: Accept any wire primitve, are splines and Beziers etc part of wires?
2: Climb v Conventional.
3: Tool offset
4: Spiral plunge to initial spiral pocket of first largest circle.
5: Possibly an algo to cut only metal where previous arcs have already cut away the stock.
Problem 1
The regular polygon problem was solved with a simple hack, wiggle the points by around 100th of a micron, this makes them non regular and the solvers will reach a solution. If this is not done open voronoi generates assertions which blows up FreeCAD. I have not worked out how to protect FreeCAD from open voronois assertions, but since introducing the wiggle have not had many crashes and am able to code and test.
Problem 2
The Path visualisation of some gcode arcs breaks down, the path you see in the screen shot has weird artifacts in the top left and bottom right. The gcode is correct, I can view it in OpenSCAM and in Mach3. I know there are CNC controllers out there which do not handle large arcs but I would favour keeping the large arcs in the model and the post processor handling breaking down arcs into smaller arc as required, otherwise if the model was to be rotated in a nesting scenario 4 arc segments would then have to become 8. Also there would have to be more python processing om every refresh.
Question 1
The path is generated from the chamfered wire points not the filleted wire of the model. I see in open voronoi there are ArcSites and am wondering if they will be more efficient than breaking down the arcs into segments. However there were no examples of using them that I could find in the many excellent examples.
EDIT Due to comment 6 I have removed the source files from the zip as that would seem to violate GPL3, the gcode file is still in there as an example of valid gcode which Path cannot interpret properly.
FacePocket.zip (5.02 KB)
