Plot trace/footprint with arcs and circles in DXF

I recently needed to export DXF files from KiCAD and open them in other software. Once open, I realized that most of the arcs and circles that were exported were not drawn using arcs and circles, but as lots of small line segments. This is greatly increasing the size of the files, and lowering their performance in some external programs. Is there a way for KiCAD to export DXF files and acutally use arcs and circles instead of approximations?

Example: On the left is a circle that KiCAD exported, and on the right is a circle that I drew with QCAD’s circle tool. I have selected them so that it is more easily seen that the one on the left is made up of segments.

I was very close to making a bug report for this. I verified it in V5.1.8 and (I think) also on V5.99 (from 2020-11-30) and verified there was no open issue for this on gitlab.

Then I updated to the latest KiCad-nightly V5.99 (2020-12-02) and this does export circles and arcs as real circles and arcs. Because it’s such a minor issue and also already fixed in upcoming KiCad versions, I will not make a bug report for it. My preference is that KiCad developers focus on getting the nightly stable and polished as soon as possible and I will not disctract them for a minor bug in V5.1.8.

If you plot to a SVG file in the stable V5.1.8 it does seem to use circles (also ovals in Inkscape) and the arc’s seem to become some kind of curve function, with just a few more control points then you would expect.

A good workaround for you may be:

  1. Exit KiCad.
  2. Install the nightly V5.99.
  3. Make a copy of your project.
  4. Open the copy in KiCad-nightly V5.99.
  5. Do you DXF export thing.
  6. Exit KiCad-nightly V5.99.
  7. Keep on working for now in the stable version of KiCad.

It is a few extra steps to get your DXF output with circles and arc’s, but once you save a project in KiCad-nigtly V5.99, you can not open the project anymore with KiCad V5.1 or older. The schematic file format has been completely changed (To S-expressions), and there are also other changes in other file formats.

If you want to help with locating and reporting bugs in V5.99 that is wonderful of course. But be aware of this file change. Do not use V5.99 for production work just yet.

Application: KiCad

Version: 5.99.0-unknown-71ab42e60~106~ubuntu20.04.1, release build

	wxWidgets 3.0.4
	libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3

Platform: Linux 5.4.0-54-generic x86_64, 64 bit, Little endian, wxGTK, mate, x11

Build Info:
	Date: Dec  2 2020 10:20:01
	wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
	Boost: 1.71.0
	OCC: 7.3.0
	Curl: 7.68.0
	ngspice: 31
	Compiler: GCC 9.3.0 with C++ ABI 1013

Build settings:

or you can use a kicad plugin

Export pcb technical layers to DXF

What version of kicad, nightly or 5.1.x?

It does use line segments for filled circles but not-filled circles should be output as circles.
The implementation is wrong since it should be using a HATCH object for filled circles instead of grossly using segments with silly width.

I have been running KiCAD 5.1.8. Good to know that it seems to have been fixed in the nightlies. I have no problem waiting, as I have manually replaced the segments with circles/arcs in the relevant files for now.

It’s not really fixed in the nightlies. Circle shapes will be exported as line segments by the current plotter architecture because unfortunately it’s passing in the rendered polygon in the canvas to the plotter rather than the “circle”. Unforunately the plotter is oriented to gerbers, even for DXFs.

Circular pads and such however get passed in as circles so those get placed as dxf circles. However they have a questionable hack to render filled.

This will most likely be fixed in v7 with one dev team member planning to rearchitect plotting.

I was confused by makerkr’s last post because I tested it yesterday and the nightly I used did put real circles and arc’s in the DXF.

So I did a little bit more testing.
When using: Pcbnew / File / Plot / Plot Format [DXF] on a copper layer, circles and arcs are transformed to line segments, but when the “User.Drawings” layer is plot, then it puts real circles and arc’s in the .DXF file, at least when the checkbox in “DXF Options” [ ] Plot graphic items using their contours is turned off.

Some more testing reveals that this is the same behavior as in KiCad V5.1.8, so there seem to be no changes for this in the nightlies.

You (Marsfan) apparently already discovered this when you wrote in your original post

Back to the orignal question:

Turning off the [ ] Plot graphic items using their contours checkbox seems to help when plotting a graphical layer.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.