Originally Posted by nickzl HELP!!!
I need the algorithm or ready for use C/C++ code for Gerber RS724X to Gcode Converters, especially I need the algorithm for tracing the isolation of the board.
Please help!!! |
I just find the way to do that. Now I am working on it.
Now, just for information, I will tell you the way.
1. From Gerber file, read information for tools, cercles and line's coordinates
2. Draw rectangulars from line coordinates and tool (only border, not fill the rectangular).
3. Draw a cercle at ever end of lines where its diameter is the linewidth.
4. Draw cercles (not filled)
5. Delete every segment in the rectangular shape and cercles. At this moment, what we get is the clear edge of the circuit. You may think to use edge detection method or contour detection or other image processing, however, as I am now in this step, I can say that this methode is faster and easier buy can work only with Gerber file.
6. Last step and most important is to search for the edge, this time you may use some image processing technique by scanning pixel per pixel untill it find the edge (any edge), than follow the edge (follow the color), and after passing through each pixel, change the color of that pixel so that you can skip this contour for next scan.
Hope this algorithm can help you. For me, I am using VB6, so I cannot give you the code in C or C++ (no time and not skillfull with this language).
Any comment will be welcome back.
May God, the Father of our Saver, bless all of us.
Take care with love.