Possible to import reference drawing for physical layout

Working with friends on a PCB that will go behind a panel with cutouts for buttons.

What we’d like to do is import a dimensionaly correct drawing as a reference for correctly placing the buttons.

Having issues getting something sensible to import and stay in place.

I assume many people have done this before for other things, we’re still learning.
Have searched and read the Pcbnew doc for answers but no luck yet.

Any help appreciated.

This thread might help. It talks about back engineering though suggested procedures are relevant to your task.

Alternative: use freecad to get it really right. I guess you have a CAD drawing of your panel and a 3d model of the buttons, if so then import everything into freecad, use freecads powerful tools to align the buttons and push the loctions back into kicad.

See Kicad StepUp: a Seamless ECAD/MCAD PCB Data Integration

Nope, no PCB exists to work on.
For better context we are creating a replica of an A-10c CDU (Cockpit Display Unit)
We no access to a physical unit, but have dimensions.


So we need to position the footprints on the PCB so that when the PCB is attached to the rear of the above panel everything lines up.
Friend has a DXF file that we’ve not been able to successfully import, results were something like this…

seems that the one import generated the white outline where it appears as if all straight lines are on the right of the 2 drawings and all curved pieces have ended up mirrored (numpad should be on the left) and placed beside it.

Disregard the footprint placement, friend was just roughly sorting them.

There is a more preferred drawing i can’t find at the moment that has the centers of the buttons marked, but not sure where it was left.

Pictures probably tell the story better then my OP, apologies for the.

End goal for more context…
image

I was recently working on a similar problem. DXF import is usually the recommended way, but there are often problems with compatibility.

In my case I am doing 3d modelling with OpenSCAD, and DXF is not that convenient. Instead I developed a programmatic method. An input script is used to generate a module or PCB overlay.

e.g

// generate pcb for type 86 box enclosure

origin 100 100

layer Edge.Cuts
rect 80 80

layer Dwgs.User
translate 0 0 cross

translate 0 13.5  rect 67 20 cross 2


translate 5 -17.5 circle 6.5 cross
translate 15 -17.5 circle 6.5 cross
translate 25 -17.5 circle 6.5 cross

translate 36 36 hole 2.5
translate -36 36 hole 2.5
translate 36 -36 hole 2.5
translate -36 -36 hole 2.5

A software program generates PCB features such as outline, cutouts and drills. e.g

Although I designed it as a script language, it would be easy to read a CSV file containing a list of features. If you think that might be useful, I would be happy to generate files from your data.

Are the drawings published anywhere?

1 Like

Simple to do…

I make PCB’s on my CNC mill. Have done boards several ways; from FreeCad, Solidworks, Inkscape… a dozen other App’s, all in an effort to gain knowledge and dial-in the most efficient approach (for me).

KiCad has become my Go-To App for all my PCB work (thank you KiCad folks!).

My Approach:
•Draw the PCB shape on a layer that can be included in Gerber output such as Edge_Cuts.
Copy & Paste will get it done quickly.
•I add dimensions and comments on a User layer.
•I add Layer Alignment target.
•I add a ref target for the Mill’s bit home position.
•Plot the Gerbers.

The image below shows:
Kicad’s Edge-Cut-Layer file loaded into CopperCam(green) and the Milled shape(Copper).
I did NOT bother to select proper End-Mill-Bit or do any other aspect of machining the board - did only a few items for you to get the idea.

The 3-D view also attached…

You can draw the face-plate in a separate PCB file in your project or, use the board containing the circuit - all approaches will work.
You can set the Grid and finely draw and move the items…etc.

This took only two minutes to draw and is much less time than fussing with importing…

KiCad file attached: panel1.kicad_pcb (14.1 KB)


This approach emphasizes more so on the use of a seperate layer e.g. the ‘Dwgs.User’ to line up geometries. Whether photo or drawing does not make much of a difference.

What I keep finding very useful is to work with the grid origin (S).

Then there is the ‘Move Exactly…’ (Ctrl+M) command as well.

In case this does not suffice, and as already mentioned, there is always FreeCad with its ‘KiCadStepUp’ plugin.

from your post I can see you have:

  • a first PCB edge in pcbnew to work with
  • a DXF file with the required dimensions

then you should be able to handle your task as suggested above by @Rene_Poschl

Many many ways to skin a cat.
In the end my buddy went with @Rene_Poschl 's solution.
@BlackCoffee 's suggestion sounds like what I’d do if i had to do it again.
@jos has said some interesting things to say too, i’ll continue reading up re working with the grid and precise measurements.
Much appreciated everyone.

… adding…

My approach (above) works great. Often, however, I need to make a Box & Face-plate on 3D printer.
For that, I use FreeCad, like this:

•Design the Face-plate in the Part Design workbench (it starts with drawing in Sketcher workbench. No need to Pad/Extrude it for using it in KiCad)
•Switch to the Draft workbench.
•Click the Icon that toggles the sketch to/from Draft to Sketch (see Red box in image below).
•Select the Draft items in the tree and Export as DXF.
•Import the Graphic (DXF) into KiCad.

1 Like

That’s looks really neat, I must get into FreeCAD! Eventually, my Prusa Mini will arrive…

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