From: fritz <fri...@gm...> - 2012-05-27 11:08:11
|
I have a new branch "douglas" to push to the repository. In it I have an implementation of the Douglas-Peucker simplification algorithm. My work (in C++) is based off of a bit of python code used in the "image-to-gcode" feature of linuxcnc (http://linuxcnc.org). Current notes: - a new boolean option "--smooth" added. - I've subclassed NGC_Exporter. I realize I could've simply added in logic to NGC_exporter to act on an option, and that will probably be what the finished version will have. For now, the switch between the base and derived class occurs with what ends up in the shared_ptr<NGC_Exporter> in main.cpp. - The python version (which is in lib/python/rs274/author.py of linuxcnc's repository), can produce arcs - G02/G03 moves. My code currently does not - I am still learning the precise semantics of using float numbers in C++ vs Python. My code produces lines that closely approximate arcs, but somehow things do pass the logic test to make an arc. This is something I'm most focused on. - The DPA does not like closed paths. When given a path whose endpoints match, the DPA will simplify it right out of existence. To combat this, I've made my buffer object not only break a path into two, but also do it when it receives moves that are larger than the tolerance. - At 1000dpi, DPA output is a little rough. At 5000dpi, it looks really good, and the file size is much smaller than the regular output of pcb2gcode. |