I am looking for links to algorithms for building on a mechanical mail plotter.
In particular, I have a list of direct vectors, each of which represents a string to be constructed. First I want to remove duplicate vectors, so each line is displayed only once. It is easy enough.
Secondly, there are many vectors that intersect, sometimes at endpoints, but not always. They can be built in any order, but I want to find an order that reduces the number of times the pen needs to be raised, preferably to a minimum, although I understand that it can take a long time to calculate, if it calculates at all. Vectors that intersect can be broken down into smaller vectors if that helps. But in general, if the pen moves in a straight line, it is best to keep it that way for as long as possible. Thus, two parallel vectors connected to each other can be combined into one vector, etc.
This sounds like some sort of graph theory problem, but I know little about it. Can someone point me to links or algorithms that I need to learn? Or maybe an example code?
Thanks,
Neil
source share