How to reduce segments in DXF file
How to reduce segments in DXF file
(OP)
Hello! I am extracting points coordinates (X,Y) from DXF file. The problems is that there are tens of thousands of points extracted, but I need up to few hundreds points. How can I reduce the number of points and segments. The files are exported from Eagle (PCB design) and it is not too complex. I can't export new files with smaller amount of points and lines, but I can work with the DXF files using Draftsight. Thanks a lot!





RE: How to reduce segments in DXF file
However, I have some (ancient) experience manipulating DXF files directly with a text editor.
That is possible because the DXF format is publicly documented.
It is not easy because DXF files tend to be quite large, and many text editors are not capable of dealing with large files.
The one I used most, back in the day, was a programming editor named PI, sold by an outfit in San Francisco. I have no idea if it's still available, but others existed. ISTR that PC-Write could do amazing stuff that no other editor could do, but I don't recall if it had a file size limit.
I am guessing that part of your problem is that curved edges were exported as polygons, and you are only interested in the centers. Perhaps you can induce Eagle to export features of interest in a different color, or on a different layer, or perhaps Eagle has a setting to export curves as curves.
You may also find the Unix/Linux tools like grep and sed and related stuff of use.
Mike Halloran
Pembroke Pines, FL, USA