I hope you in Burnley have not been too heavily affected by the flooding in Northen England.
How about a picture of your router/setup?
I am also keen to use this method for quick PCB prototyping & would be interested in your experience/advice.
Your optimisation problems/ideas are a major research topic for many large companies and effective tools/algorithms are
correspondingly expensive/hard to find/jealously protected (!)
The basic problem is how to map a simple list of points into the more abstract (and deceptively complex) concept of
the "best path". This is related to the famous "travelling salesman" problem & is usually solved in a heuristic manner
rather than using a fixed algorithm. This approach can yield useful results but one cannot guarantee that the best
possible result has been found.
This field of research is huge and can lead you into a mind-boggling world of abstract algebra. Intellectually interesting
if you like playing with Rubik's cube (more relevant than you might think) but not really immediately useful to you.
I suggest you take the Engineering approach (near-enough is good enough)
rather than the Scientific approach (find the absolute truth) and make a compromise between
manual optimisation and wear on your milling bits...
One simple approach is to write a program that does the following:
1/ Parse the Gcode text file and visualize the path followed by the router as a line graphic on the screen, +
with large dots/labels displayed at each Gcode point in the original file
2/ Use the awesome abstract analysis capabilities of the human brain to identify & improve inefficient paths
- Being able to rearrange the sequence using drag&drop would be really kool feature...
3/ Create a new Gcode text file & go to step 1
Do this until you get bored or things are good enough...
I wouldn't use C for this but rather a good high-level IDE environment.
I build systems in many different languages/operating systems depending on the requirements.
Unix is dear to my heart (since 1980..oh brother...so long ago!!)
but I always try to use the best tool for the job, regardless of the origins/politics of the evil empire responsible..
At the risk of getting flamed I gotta say that Visual Basic/Visual C# is awesomely useful for
rapid prototyping of applications that have non-trivial IDEs.
You can quickly & brainlessly build what you need without wasting time on the details.
You also have a HUGE base of existing code for every conceivable task, which saves you enormous amounts of time
Yeah, yeah no real object-orientation, Windows-based blah, blah... & if you are undisciplined then
the result can quickly become a horrible mess but who cares?
The aim is to play with/develop an idea not build "the next big thing" for the masses..
Over the last 5 years I have built a successful commercial system with 22000 lines of Java code using Eclipse & WindowBuilder
but still use VB/Visual Studio for fast prototyping/playing with ideas..
I hope this gives you a few ideas