Pcbnew DXF outline import reference point is not stable

Hello,
I’m using pcbnew of Kicad 5.0.0 on Windows for layout. I want to import an odd shaped PCB outline that I have drawn using LibreCad 2.1.3 using lines, arcs and rounded edges. The PCB outline is saved in DXF R12 format.
I want to align the DXF with the grid used in pcbnew. So I want the placement cursor to appear at one corner or a certain location of the DXF to allow to place the DXF aligned with the grid setting in pcbnew.
Pcbnew offers five different options to set the DXF origin when selecting File->ImportDXF.
I have tried all of them, but they do not seem to provide the expected results.
Furthermore when I repeatedly import the outline using the same origin setting (i.e. “upper left”) the DXF shape appears with the cursor located at different positions.
I would have expected that the cursor would always be at the same position in the DXF to allow to precisely place the outline into the Edge.Cuts layer.
Has anyone successfully used the DXF importer?
Best regards
Jan

Try this: Remake your DXF shape so that it contains only straight lines, then try importing it.

KiCad (and every other PCB tool) has always had a problem with importing vectors that are made up of more than just straight lines. This is going to be different for whatever tool you made your DXF in, but in Illustrator and Inkscape, it’s going to be something like (select outline) -> Add Anchor Points -> ‘Simplify’, with an ‘only straight lines’ option checked.

From there, your shape should be made entirely of straight lines. If it doesn’t look right, redo what you just did, adding more anchor points. Calculus, or something. From there, the origin should be readily apparent to KiCad. In the worst case, you’ll have to move the imported edge.cuts layer around to where you want it to be.

…And it’s not just KiCad 5.0 on this. It’s literally every piece of software that imports DXFs except gimp and illustrator.

Managing DXF outlines, 3d models, footprint aligments and more things is easier with kicad-stepup and Freecad. Not difficult to learn.

2 Likes

That is weird, it seems to select a different vertex randomly.
Also weird, regardless of the origin chosen, the outline “sticks” to the mouse pointer after importing. Might be worth reporting as a bug.

The following applies to v5, “Modern toolset”

  1. Import DXF, select “upper left corner of page”
  2. Close the dialog without moving the mouse, preferably using the keyboard.
  3. Still without moving the mouse, press the “Return” key
  4. Select the outline using “lasso” around all the lines
  5. Now move the cursor to worksheet (0,0) position
  6. Press “M” key
  7. The outline now moves with the mouse, and the mouse pointer is at (0,0) in the original outline.
3 Likes

Hi Bobc,
this is exactly the problem I am experiencing! Many thanks for your detailled description.
Also your workaround seem to work stable. It took me a minute, because you have to hit return twice:
First to close the DXF import dialog, second to drop the outline to the pcbnew worksheet.

Then my DXF always appears with it’s origin at the upper left corner of the pcbnew worksheet. From there I can select it again and move it to the desired position.

Furthermore I do not have a problem with the DXF itself. I have created it with LibreCad just using primitives like lines, circles and arcs, then using the rounding tool to chamfer the corners to the milling bit size used in PCB manufacturing. Saved this as R12-DXF works like a treat. Be sure to use the “snap to the end of line” tool in LibreCad so that you get one perfect outline without holes. Otherwise Kicad’s 3D viewer will complain, beacuse he cannot figure ot the PCB shape!

Many thanks for your support!
Best regards
Jan

1 Like

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