Newbie question about board outline

I’m used to a very different kind of editor, and I definitely need to have the board outline independently “routed” (milled or cut) because I need to use all the available space in the molded box it will reside in, and to intentionally avoid the molded corner bosses in the process. With the editor I was using that information was entered by placing a track on the “outline” or “keepout” layer. In some cases I’ve even extended the cutout/routing into the interior of the PCB. I suppose I’m confused because of the large number of layers and not having experience in what information is in the symbols on each of them but in any event how is the board outline intended to be established when it’s not a simple square?

In Pcbnew the board outline is defined by drawing lines (not tracks!) on the layer “Edge.Cuts”. This layer is selected when a small blue triangle is before it:
Then use:

Pcbnew / Place / Line
Pcbnew / Place / Arc

to draw lines and arc segments on this layer.
Endpoints should fit exactly, so use a (coarse) grid to align them easily.
KiCad is not very good in detailed graphics, and when board outlines become really complex they should be drawn in an external program and imported into KiCad.


OK, and will FreeRoute “honor” the lines so placed or will it just cruise through them as if they were not there?

Freeroute is not officially supported by KiCad, and I never used it.
I quite dislike autorouters, because cleaning up the mess they make often takes up more time than routing the board by in KiCad in the first place.
Just drawing random wires between pads is not a good way to route a board.
I really like the interactive router. It works so good that for my purposes even a good working autorouter would not add much.

In KiCad V4, KiCad itself did not even honer the board outline while laying tracks, but in V5 it does, to my pleasant surprise.

Hail to the developers, always good to see the continuous improvement of KiCad.

Internally KiCad seems to regard the board outline to something very similar to locked tracks during routing, and therefore can not go outside of it. Very simple and clever trick, and if needed you can probably also do that for freerouter, but the simplest way to find out is probably to just try it.

1 Like

Yes, FreeRoute will keep its routed tracks inside the board outline.

I sometimes use FreeRoute first just to see how it lays out the tracks - usually, for me, it does a pretty good job.

Once I have let it have a go I manually adjust anything that I think needs adjusting.

1 Like

Yes, KiCAD’s drafting tools are rather crude and limited in their capabilities.

When you get much beyond a basic rectangle, many of us find it easier to produce the outline in an external drafting program, then import it into KiCAD as a *.DXF file. I use the open-source, no-charge drafting program called “LibreCAD”, although there are others that will work as well. Even a basic CAD drafting program will let you do things like snap-to-endpoints, define arcs in at least half a dozen different ways, convert corners to arcs, find tangent points, trim (or extend) lines and arcs to their intersection with other lines or arcs, etc.

For fitting boards into commercial enclosures it’s especially useful to open the enclosure manufacturer’s drawing of the enclosure in the CAD program, then use the program’s “Offset” tool to create an outline which is a fixed distance - say, 25 to 30 mils (1.0 - 1.2mm) - inside the enclosure’s interior contour. This makes it especially easy to deal with things like screw bosses, molding sprues, etc.

Here’s an example similar to what you are trying to do:
Start_Gun_Transmitter_C-Dwgs.User.pdf (10.0 KB)
It shows a board outline designed to hug the interior contours of a commercial enclosure, with some cutouts for switches, connectors, controls, etc. The outline could have been created with KiCAD (plus a lot of patience), but I did it with the method outlined above.



Crude, yes, but not that bad. Just as long as it can be drawn with all endpoints on a relatively coarse grid to make all endpoints match it’s pretty trivial to draw the board outline in KiCad.

I just did a simple test in KiCad V5.1.0 and drew a (pretty random) arc.
After placing a random arc you can drag, center, start point and end point, which gives you enough of an interface for a decent manipulation of the arc. You can also punch in the numbers if you select the arc and press ‘e’:

But even more importantly:
If you draw a (also random) line and drag the endpoints of the line, then the line snaps to the controll points of the arc and this makes it easy to generate a closed outline.
The start point of an arc is on the grid, but because of the Pi thing in arcs the endpoint of an arc is not always on the grid, it just is closest to the gridpoint your cursor is on. Meaning, that if you want to use non 90 degree arcs, you have to drag the end point of a line to snap to the end point of the arc, and not the other way around.

1 Like

I’m not sure of what I am writeing, but I have read that end points of line and arc need not to be exactly at the same point to be assumed by KiCad that outline is closed. They only have to be close enough (don’t know how close is close enough).

KiCad itself works on nanometer or 10nm resolution, and it woul be mad if not some kind of tolerance was build in, but I don’t really care. I don’t even want to come close to whatever the tolerances could be and to play it safe the only acceptable way is to snap the end points together. I’t simple enough to do.

The tolerance is currently hardcoded at 0.1mm as of the last time this was discussed on the mailing list.

But the line becomes not exactly horizontal or vertical. Don’t suppose it can have any important consequences but I would not like it.

Ah, yes, when you draw a triangular board with rounded corners and slots cutout in it’s circumference, then it’s not exactly horizontal or vertical.

A grid can keep your corners perfectly square, and so can symmetry in the schematic, but as mentioned before, KiCad is not a mechanical CAD program, and when board outline compexity goes beyond a few rounded corners and cutouts, then it’s better designed in an external program.

Digital data is becoming evermore important and in these modern times you start to expect that if you buy an enclosure, it comes with a website link to downloadable mechanical drawings, or even a drawing of a fitting PCB outline.

Have a look at Mc Master-Carr. They have downloadable CAD files for almost everything.

1 Like

Wow this is like drinking from a firehose but it’s all great. By the way my old platform can export DXF so maybe that will handle board outlines. Now I don’t suppose KiCad can import any formats like Protel .PCB or Gerbers? My other question is what is the “preferred” way to place the board mounting holes, would that be 360 degree arcs on the edgecuts layer or just place a multilayer pad sized for minimum annular ring? I would hope if it’s on the edgecuts layer somehow that hole winds up being on the Gerber drill list automatically? Like I said love all the info here, thanks this is like getting a free course in this tool!

I probably don’t have the authority to say this, but the “preferred” way is to use the “MountingHole_xxxxxx.kicad_mod” footprints in the standard KiCAD footprint libraries - either straight from the installed library (eventually you’ll be sorry you did this), or copied into your personal library files (a wiser approach, in the long run).

You should “Lock” the footprint after you get it placed, so that it doesn’t get swept into the bit-bucket the next time you update the board from your schematic. (Or, figure out a clever way to associate the mounting hole(s) with a symbol on the schematic, but in a way that people won’t point to the schematic symbol and ask, “What’s that strange thing doing here?”.)


If you open a gerber in KiCads Gerbview, then you can back import a large part back into a PCB file. (Board outline, holes, tracks, pad locations). Not perfect, but much better than nothing.

And if this is like a firehose to you, then do not ever attempt to read the manuals.
Do not press [F1]. that may lead to some 500+ pages of reading in total…

Unless of course you want grounded pads around the mounting holes, in which case the simplest method is to add them to the schematic so you can connect them to your GND, and then associate the properly-sized footprint before heading into PCBnew to place them.

Yeah I already figured the docs were inscrutable, all I needed to do for that was just try and find things in the interface as it stands, yikes. (In the past I’ve been known to say RTFM myself but good grief!)

When you import a new schematic it throws out what’s already on the board that’s not locked down? Whose idea of sanity was that???

Is there any chance I’ll get lucky and find compatibility on the netlist format too, or is it just based on that Specctra thing? It’s not all that big a deal but every little bit helps.

Oops, it was not meant that way.
I actually find most of it quite readable and you learn some things you would not have otherwise.

This was always the case. Especially as there is a switch “Delete extra footprints”. (What did you think that switch does if enabled? That switch is not even enabled by default so you must have enabled it. This switch always existed in some form in the netlist import. V5 also brought it into the update “pcb from schematic” tool that was previously half finished in nightly.)

I also requested a better alternative to the position lock:

Which is why all connectors in the official lib that have either SMD pads or plated through hole pads for mounting (should) have them with the pad number MP. Fitting connector symbols that include a pin with pin number MP are found in the Connector_Generic_MountingPin library.

Similarly with shielded connectors but here the pin/pad number is SH.

Very logical sanity, because the board should normally reflect the schematic.