PCB Custom Shapes, Cutouts, Holes… Simplified

It took me a bit of time to work out a process that works well enough, and consistently enough for my needs. I used various posted tips and the (old) how-to-do-it documentation and I’m posting this simplified approach…

This works with Inkscape and EZDraw. It will probably work with other drawing software as long as it has ‘Layers’ to draw on with re-namable ID’s.

SVG files are XML Text files and can be opened/edited in text edit software and re-naming can be done this way, too.

Various versions of the drawing app’s I used seem to change with their revisions (especially OpenSource) so, to the point, the need is to edit the XML file and change the ID of the layers. It’s as simple as that. Inkscape does have an embedded XML editor with a display panel.

It doesn’t matter what’s called a hole or cutout… they need to be Boolean Difference’d from the PCB board (but, done on the same board layer). Silkscreen is on a separate layer.

Inkscape will need to generate Object to Path, whereas EZDraw takes care of that automatically.

Screenshot attached showing various steps described below…

HERE WE GO:

Inkscape
1) Create two sublayer’s for the default ‘Layer 1’ and place them in this order
⁃ Layer 1
⁃ board
⁃ silkscreen
2) Open the XML editor
⁃ Edit > XML Editor
3) Select the top line of the “Silkscreen” group
⁃ Note: the “Label” is not important, the “ID” is important
⁃ Select ID, and enter “silkscreen” and press Set button
⁃ simply replace the defaulted text (
4) Repeat #3 for the “board” group
5) Select the ‘board sublayer’ and draw the PCB perimeter shape (such as Rectangle)
⁃ Select the PCB perimeter
⁃ Select from Menubar: Path > Object To Path
⁃ WAIT!!! It may take 15 seconds to process. Look at the bottom of the screen for indications that it finished before going further
⁃ Draw the Holes, Cutouts… other
⁃ Select the PCB perimeter and only ONE of the Holes, Cutouts, other
⁃ Select from Menubar: Path > Difference
⁃ WAIT!!! It may take 15 seconds to process. Look at the bottom of the screen for indications that it finished before going further
⁃ The Hole (whatever you used) will now be incorporated into the PCB perimeter/shape.
⁃ Repeat for each of the Holes, Cutout…etc, doing one item along with the PCB shape at a time until all except for the Text or other graphic for silkscreen are done.
⁃ If desired, select the PCB shape and Fill with a color
6) Switch to the ‘silkscreen sublayer’ and draw items, such as Text
⁃ Recommend (as a starting point for Text) use:
⁃ Stroke = 0.25mm
⁃ Fill = none
⁃ Stroke paint/color = white
⁃ Stroke Style Width = 1mm
⁃ Select the PCB shape and the Text
⁃ Select from Menubar: Path > Object To Path
⁃ WAIT!! until done
7) Save As Plain SVG

That’s it, now can use it in Fritzing

EZDraw
1) Create two layers: board and silkscreen
2) Draw PCB shape and Holes, Cutouts on the ‘board layer’
⁃ Select PCB shape and One Hole
⁃ Select from Menubar: Tools > Combine > DIfference
⁃ Repeat for each item
⁃ Fill with color if desired
3) Draw Text/other on the ‘silkscreen layer’
4) Save as SVG (1.1)
5) Open the SVG in a Text Editor
⁃ Look for the ‘board’ and ‘silkscreen’ layer groups
⁃ Edit the ID to ‘board’ and ‘silkscreen’ (they will probably default to include something like “layer_board”. Simply delete the “layer_”
6) Save the file

That’s it, now can use it in Fritzing

UPDATE:

FreeCad
The Draft workbench can be used to draw PCB that opens correctly in Inkscape. (In Draft wb, open Preferences, and set the Import/Export>SVG to Raw for CAM.

Now, simply draw the PCB in Draft, Export the full list of drawn items, and Export the SVG. Then, it can be opened in Inkscape. You can simply Bucket fill with color (no need for Path Differencing) or, create the layers as noted above…

I just though I would let you know that the notches in your board are not holes or cutouts as far as Fritzing is concerned. You could draw your outline using any method you want as long as it is a complete outline without any breaks. It is just the actual holes that need to be a difference operation and the difference needs to be done last. If you read my 3rd tip Inkscape Tips and Tricks it explains how to fix a board that has been made incorrectly without having to start over. Like if you decide you want to make the bottom right tab longer you could move the vertices and then follow my 3rd tip and still get a working board. Otherwise you would have to start with a larger board and do all your differences again plus another to make the tab above the bottom right shorter since the goal of my hypothetical change is making the bottom right tab longer. Be sure to read my entire tips and tricks thread it has a lot of useful information.

Thank you. However, though no doubt you are correct, my method works for me and I’ve CNC machined many PCB’s this way.

I use CopperCam with Fritzing’s exported Gerber files without problems. The final graphic image of Fritzing with the example needed something for a valid export so, I added a resistor (thus the two holes in this attached screenshot). I did not bother to cleanup or do anything beyond importing into CopperCam and doing a normal process for it, including exporting gcode.

As you can see, the PCB’s contour (shape and cutouts (call them what you want) and hole) are correctly processed and, if desired, I could run it on my CNC and get what I wanted.

.

Your points/comments are appreciated…

I was not saying you did anything wrong I just wanted to point out that you can alter your board afterwards by simply breaking it apart and redoing the differences after and pointed to my old thread which explains how to do that.

UPDATE:

Brief follow-up…

I used several drawing App’s to determine usability with respect to ‘my’ needs and desire to make the process painless.

One of the Apps is call ‘GravitDesigner’. It had flaws and the user interface is much like a typical drawing app but carries along with it the usual need to learn it. I prefer the user interface of EZDraw but can live with Gravit.

I was pleased to see Gravit was updated and the bug’s fixed. So, I tried it yesterday and am a happy camper :grinning:

Sure, it took me some minutes to go through their tutorials BUT, it was worth it!.
The Best Part about using it is the ‘Layer’ panel which eliminates the need of messing with XML (especially in InkScape).

I discovered that I can drag and drop the Layer’s label into another Layer to yield Sub-Layer’s and rename as needed.

Plus, I discovered that setting an element to a Symbol will make it a sub-layer and sets the ID to the name of the label. Seems to work great for the PCB’s that I make.

If it works out (will try it today), making ‘Parts’ will be easier than using Inkscape and editing the XML (for Pin connections…etc). Will follow-up and post to the reference post…

Two images attached:

  1. Collage of Gerber outputs from Fritzing. The Copper colored item is the result in CopperCam - the app I use to generate Gcode for CNC machining PCB’s. The Black dot is a ‘Hole’, using the ‘hole’ part in Fritzing.
  2. Gravits user window (for Mac but, I imagine their Windows version is much the same)