DXF to copper pour conversion

Post your circuits and ideas here
Post Reply
Message
Author
Tomg
Expert
Posts: 2024
Joined: 20 Jun 2015, 07:39

DXF to copper pour conversion

#1 Post by Tomg » 01 Apr 2021, 16:16

If anyone is interested, here is a convoluted workaround to convert a DXF file into a fully-functional copper pour. This is a long and involved process, but so far it seems to be working. Let me know if you find any errors. Make sure to have a backup copy of your DipTrace board file before starting...

1) Copy the included file named "template.txt" to your desktop for later use...
template.txt
(758 Bytes) Downloaded 165 times
2) Open a new instance of the PCB Layout editor, in the main menu choose File > Import > DXF..., locate/select/open the desired DXF file containing the shape outline you need (set DXF Units: same as file, Import Mode: Add, Convert to: Top, enable the options [x]Fill closed areas and [x]Embedded Polygons), then click on the [Import] button. The new shape that will eventually be converted into a copper pour should now be displayed on the Top layer.
3) In the main menu choose File > Export > DipTrace ASCII..., save to your desktop and then close the new instance of the PCB Layout editor without resaving it.
4) Using a text editor open the newly-created DipTrace ASCII file and perform a search (enable the case-sensitive option) to find the first line that begins with "(Shapes". A few lines below that, right after "(PenWidth -1)", will be the points section.
5) In the points section select/highlight all lines between and including the "......(Points" line and the closing parenthesis "......)" line (the periods represent spaces) located just after the last set of point coordinates. You should have selected/highlighted something similar to this...
pc.png
pc.png (10.25 KiB) Viewed 1391 times
6) Copy the selected/highlighted lines to the clipboard (Ctrl + C) and close the text editor.

7) Open the included text file named "template.txt", without selecting/highlighting anything move the cursor to the very beginning of the "......(Lines" line (the periods represent spaces) and paste the contents of the clipboard (Ctrl + V). It should end up looking similar to this...
mt.png
mt.png (18.05 KiB) Viewed 1391 times
8) Select/highlight everything (Ctrl + A), copy to the clipboard (Ctrl + C) and close the text editor without saving. This is the code you will need to add the new copper pour to your existing PCB.

9) Open your project board in the PCB Layout editor, in the main menu choose File > Export > DipTrace ASCII... and save to your desktop.
10) Using a text editor open the newly-created DipTrace ASCII file and perform a search (enable the case-sensitive option) to find the first instance of "(CopperPours".
11) Without selecting/highlighting anything, move the cursor to the beginning of the very next line, insert the contents of the clipboard (Ctrl + V), make sure to resave as an ASCII file (*.asc) and then close the text editor.
12) Returning to your board in the PCB Layout editor, go to the main menu, choose File > Import > DipTrace ASCII... and locate/select/open the newly-created ASCII file.

If all goes well, your project board should now include an unpoured version of your new copper pour.
Tom

Post Reply