How can I design a PCB that is made of multiple intersecting shapes?
For example, this:
I have designed only one non standard shape and it was in V5 times.
I used LibreCAD and probably File-Import-Graphics…
Best idea is to draw this rough version of this outline first on a different layer like user.drawings or user.comments , layers.
Then draw the outlines on the edge.cuts with a very thin line, like 0.1mm thick. Following your rough drawing on the user.drawings or user.comments layer.
Another option is to use a drawing program that can export to dxf file format and then load this dxf file temporarily on the user.drawings or the user.comments layer.
Then draw the outlines on the edge.cuts with a very thin line, like 0.1mm thick.
After you are finished with drawing on the edge.cuts layer :
Just delete all temporarily lines and circles on the user.drawings or the user.comments layers.
Like making a sketch first.
The graphic items on Edge.Cuts have to form a “perfect” outline. Things like intecting or overlapping lines are not allowed, and neither are open line ends, or gaps between lines, arcs etc. So you have to construct this out of 6 arcs instead of 4 circles. Lines that are inside the “outmost outline” are interpreted as cutouts in the PCB.
Your shape is still fairly easy to draw in KiCad itself, provided your shape fits on a single grid. Mechanical CAD drawing is surely not KiCad’s strongest point, and when the PCB outline becomes more complicated, a much better option is to draw it in a mechanical CAD program, and then import it in KiCad.
Drawn in FreeCAD 1.0.1 in about 10 minutes
KiCad is not ideal for drawing constrained mechanical drawings and shouldn’t be.
My standard advice first: always inform the reader about the used kicad version. As kicad gets more&more functions implemented a correct answer depends on the information (kicad version).
Assuming you are using the actual stable (and supported) version v9:
- the classic way to achieve complex shapes in kicad is to use a external cad program (freecad, qcad, any xyz-cad) to draw the shape, save as dxf and import this dxf into kicad. This is my preferred workflow (using QCAD).
- using freecad there is also the option to use the specialized KicadStepUp workbench for collaboration between kicad <–>freecad
- very often it’s enough to get the board shape only roughly right with tolerances of 1…2…3mm between pcb and enclosure, in this case just draw arcs in kicad and approximate the shape.
- if you really need the exact shape: kicad v9 got some enhancements in the mechanical section - your task at hand could in theory now relatively easy be solved in kicad itself:
- draw the circles (which you already have), set the shape to “unfilled”
- select the shapes → RMB-click–>get context menu → create from selection → create polygone from selection
- choose option “use linewidth from first object” (otherwise you get again a filled shape)
- examine result: all circles are now polygones
- select all polygones → RMB-click–>get context menu → Shape modification → merge polygones
- you get a nice shape, made up from polygone points. The requirement mentioned by paul is fulfilled (because a polygone is by definition a closed shape), so it seems all looks good.
- but now the disappointing part: after saving/closing kicad/reopening kicad+board the shape looks not good anymore. This seems to be a bug (merge polygone operation: good result, but distorted after save/reload action (#21134) · Issues · KiCad / KiCad Source Code / kicad · GitLab). But after this is fixed the workflow should get you the result you want.
hmm why not. yes it would be a fair amount of dev work but given that datasheets are all dimensioned drawings it would be a big boost to user experience.
KiCad already allows you to draw footprints to exact coordinates. Most datasheets give relative dimensions, which complicates things.
Something like this arc based outline requires much more complex constraint based drawing, where these arc segments are forced to touch. Once you get into the many constraints possible in a simple 2 CAD drawing, the code gets complex. The FreeCAD Sketcher component is still in active bug fix and development after two decades.