Hey Guys, Im currently working on the dxf 2 gcode converter and looking for some thoughs on toolpath sorting and ordering, I would really like comments if you have some, a gram of design beats a ton of re-implementing.
Current logic:
0. Determine encapsulation of any toolpath by a closed two dimentional toolpath (object)
1. Determine encapsulation of any toolpath by a closed three dimentional toolpath (object)
2a. If only encapsulated 2d toolpaths are found start by cutting the most encapsulated closed toolpath with the smallest surface area
3a. Work your way out of the encapsulation always cutting the smallest surface area piece
4a. Once all closed toolpaths have been cut do the open toolpaths in the optimized order translating the least total x/y movement
5a. Finish by drilling any holes
2b. If encapsulated 3d toolpath is found start by cutting the the toolpath which closest part is the furthest away from center and work inwards
3b. Finish by drilling any holes
Tool Offsets are determined by the encapsulation, if an object is not encapsulated it is assumed that the actual toolpath should be outside of any closed toolpaths.
If an object is encapsulated an odd number of times the actual toolpath is assumed to be inside of any closed toolpaths.
If an object is encapsulated an even number of times the actual toolpath is assumed to be on the outside of any closed toolpaths.