Making cut outs in PCB

Hello,

I am having trouble with cut outs in Frizting.

Here is the board I am trying to design (except for the bogus LEDs), as seen in Fritzing:



You see the board has a donut shape with a rectangular bulge on the right. I have attached to this post the svg file for the board (MS PCB 5.svg) and the Gerber files exported from Fritzing (donut.zip in the next comment).

As you can see from donut.zip, the problem is that the board outline does not show the hole. I used subtraction, i.e. the method recommended in this link, but it does not work. I also tried to use subtraction to modify an external PCB path and it does seem to work. There seems to be a problem when the extra path enclosed is inside the outer path. What is the method to do Cut outs?

Thanks,

1 Like

Here is the Gerber file mentioned: (donut.zip).

Hi Andy,

Yep, that is really weird…

Try adding a third layer, “silkscreen0”; silkscreen0 is the bottom contour. Just duplicate “silkscreen” and name it “silkscreen0”. It should look like this:

silkscreen0
silkscreen
board

If that doesn’t work, I will send you an svg.

Steve

@AndyPhil

Try this, it might not be exactly as you would like it to be. But I’m sure this will give you a better general idea of the layout structure during an .svg board edit. I used inkscape to do my modifications to your board file. Have fun!

http://osrss.net/fritzing-parts-people/donut/donut.svg
also a test file that was exported to gerber, all seemed to be working…
http://osrss.net/fritzing-parts-people/donut/donut-test.fzz

Good Luck!

Andy,

I forgot to one thing on your donut, This is a complex shape, you need to add the sublayer “boardoutline”. See attached link to Andys Donut: http://tinyurl.com/je3gubo

It takes awhile to generate copper layers. :blush:

Steve

Hello Steelgoose and Landracer,

You guys rock. Both of you have supplied svg files that indeed generate proper cutouts! Thank you, it is amazing to have such an active and helpful community!

I have been inspecting your svg files to try to understand what is wrong with mine, and I think I found what was the problem. What I think is happening is that Fritzing expects to see lower cap “closepath” command “z” and not upper cap “closepath” command “Z”. According to the official documentation, there should be no difference between lower and upper cap “closepath” commands. It turns out that Inkscape only generates upper cap “closepath” command “Z” therefore the second path which represents the cutout is ignored by Fritzing. In fact Fritzing does not completely ignore a cutout with capital “Z” as it produces an image that seems to have the hole in it as seen in the illustration above, but during the importation of the svg file it does say that it does not see any cutout and indeed the Gerber files produced don’t have the cutout.

To be able to work with Fritzing and Inkscape (on a Mac anyway) one has to manually edit the svg file produced by Inkscape using a text editor to replace the “Z” for “z” in the board object, prior to importing in Fritzing.

That was an interesting investigation!

Thanks again!

Creating custom board shapes

After strugging with this task, I created a procedure for our company. I decided to share it with you and hopefully save you some trouble. My configuration was working in Mac OSX El Capitan 10.11.2. I prepared the files with InkScape 0.91. Some of the content here may be OS and software specific. Hope it can help the community. :grinning:


Prepare the document

  1. Start Inkscape
  2. Select File/Save as… to save document with the name of your choice using the file type “Inkscape.svg” in the lower right hand corner pull down menu
  3. Select the “Page” tab under File/Document properties… and select the default units. It is preferable to use “px” because this is the native unit.
  4. If you board is going to be larger than the default size (sheet of paper), in the same tab under Custom size select the outer dimension of the board you want to create. Choose the dimensions of the enclosing rectangle.
  5. If you want to work with grids, select the “Grids” tab under File/Document properties… Select “Rectangular grid” under Creation and press “New”. Choose the units, “Spacing X” and “Spacing X”. In general inches, 0.1 and 0.1 are often used. Deselect “Snap to visible grid lines only” if dealing with an irregular board size and shape.
  6. NOTE: In Mac OSX, under XQuartz/Preferences… deselect “Update Pasteboard when CLIPBOARD changes” or else copied objects will be converted to images in Inkscape.

Prepare the layers
The file layers and the XML structure are two different concepts. Although the layers are not required per se, the use of sublayer make for a tidy file. The XML structure requirements are as follows: the board, top and bottom silkscreens “svg:g” objects need to be nested under a unique “svg:g” object, itself being nested under the main “svg:svg” object. The id of this “svg:g” object can be anything. The names of the board, top and bottom silkscreens “svg:g” objects need to be set according to the instructions below.

  1. View the layers and sublayer by selecting Layer/Layers…
  2. Board sublayer. First select the top layer (usually Layer 1) and press on the “+” sign in the Layers window. Choose “Add sublayer to current” in the drop down menu. Rename this sublayer as “Board sublayer”, by double-clicking of the automatically generated name.
  3. IMPORTANT. The id of the board “svg:g” sublayer you just created has to be change to “board”.
  4. Top Silkscreen sublayer. First select the top layer (usually Layer 1) and press on the “+” sign in the Layers window. Choose “Add sublayer to current” in the drop down menu. Rename this sublayer as “Top Silkscreen sublayer”, by double-clicking of the automatically generated name.
  5. IMPORTANT. The id of the top silkscreen “svg:g” sublayer you just created has to be change to “silkscreen”.
  6. Bottom Silkscreen sublayer. First select the top layer (usually Layer 1) and press on the “+” sign in the Layers window. Choose “Add sublayer to current” in the drop down menu. Rename this sublayer as “Bottom Silkscreen sublayer”, by double-clicking of the automatically generated name.
  7. IMPORTANT. The id of the bottom silkscreen “svg:g” sublayer you just created has to be change to “silkscreen0”.

Creating the board shape

  1. Select the ‘Board sublayer’ in the Layers window
  2. Choose the geometrical figure of your choice, e.g. Stars and Polygon tool, Circle, Rectangle or any other.
  3. Draw the figure.
  4. Select the “Select” tool and select the object.
  5. Select Object/Fill and Stroke to see what are the fill and stroke parameters. Under the Fill tab, set the Fill color RGBA to 33804080. Under the Stroke paint tab, select “no paint”.
  6. You can set the object position and dimensions precisely by using the position and dimensions fields in the tool bar above the canvas. Set the units to your preference. You can click on the lock to constrain proportions.
  7. Note that in the XML editor under Edit/XML Editor…, the center (cx,cy) and radius ® of geometrical figures are expressed in pixels.

Creating composite shapes

It is possible to merge multiple shapes by using the union operation by using the Path/Union operator.

  1. Draw and position multiple objects of interest on the same layer or sublayer using the previous procedure
  2. Select all objects that are to be merged
  3. Select Path/Union. The object has been converted to a path. The path can be inspected in the “d” item in the XML window under Edit/XML Editor…

Creating cutouts (holes) in a board

It is possible to create holes in PCB by subtracting a shape to another by using the Path/Difference operator.

  1. Draw and position two objects of interest on the same layer or sublayer using the previous procedure. The object on top creates a hole in the bottom object.
  2. Select the objects that are to operated
  3. Select Path/Difference. The subtracted object is converted to a path. In fact the subtraction occurs by the addition of a second path in the “d” item in the XML. Each path are bound by the “M” and “z” commands.

Draw the silkscreens

In these steps, we create silkscreen objects as outline copies of the board shape.

  1. Select and copy the board shape object you just created. The simplest way to do this is to use the XML window. Select the board shape object and press on the “Duplicate node” icon. Using the other XML tools, press promote, down and demote buttons. This has transferred the copied object to the top silkscreen sublayer. You can also use copy from the board sublayer, select the top silkscreen sublayer and paste.
  2. Select the fill tab under Object/Fill and Stroke and disable the Fill
  3. Select the Stroke paint tab enable Flat color and set RGBA to ffffffff (this maybe hard to see, but if the silkscreen layer has a tiny white border)
  4. Select the Stroke style tab
  5. Set width to Inch and set it to 1 mill (0.001 Inch) or 1 px or similar value
  6. You can repeat these steps to generate the bottom silkscreen object. If you copy the top silkscreen object, you won’t have to change its Fill and Stroke attributes.

Finishing touches

  1. Select the “Page” tab under File/Document properties… and click on “Resize page to content…”. Press on the “Resize page to drawing or selection”.
  2. NOTE. In some cases, Inkscape generates upper cap “closepath” command “Z”. According to the official documentation, there should be no difference between lower and upper cap “closepath” commands. I believe Fritzing expects to see lower cap “closepath” command “z” and not upper cap “closepath” command “Z”. Therefore the second path which represents the cutout is ignored by Fritzing. In fact Fritzing does not completely ignore a cutout with capital “Z” as it produces an image that seems to have the hole in it, but during the importation of the svg file it does say that it does not see any cutout and indeed the Gerber files produced don’t have the cutout. When this happens, one has to manually edit the svg file produced by Inkscape using a text editor to replace the “Z” for “z” in the board object, prior to importing in Fritzing.

Importing the custom board shape in Fritzing

  1. Start Fritzing
  2. Select the “PCB view” tab
  3. Select the PCB. In the inspector window press on “Load image file”
  4. Select the svg file you created
  5. Et voilà
2 Likes

Andy,

You make it sound difficult… I don’t use Inkscape, I used CorelDRAW X6, it wasn’t nearly that much trouble. Rumor is that corelDRAW X8 is coming out next month… be worth looking into. Made two circles and a rectangle, created two copies, changed the colors and names, then exported as svg, and I was done… Fritzing is pretty forgiving, keep the code as simple as possible…

~Steve~

@AndyPhil

Thanks for the wonderful write-up in-regards to making custom cut-out boards using inkscape. Hopefully this can help folks with their future endeavors. Great job! Thanks for using fritzing!

niceone! Thank you.

The devil is in the details. And also nice to see how the keyboard commands are used in inkscape

Maybe a few things can be done in a less complicated is this in any way related to the absence of the rightclick on a mac?

Please add save as plain SVG

@AndyPhil Thanks for your comprehensive step by step tutorial!

I cannot get it to work…
I have downloaded andys_donut.svg. made a pcb, saved as gerber.
Uploaded to easy gerber viewer.
However I still do not see the cutout, same with my own files:

buttonholderpcb.svg
test.fzz (2.7 KB)

Any clue what I am doing wrong?

I don’t know anything about making cutout PCBs, but from here it looks cutout.

In Gerbv it shows the internal square in the contour layer, but I don’t know if it’s a hole.

Any experts out there.

I clicked the fabricate button in Fritzing and uploaded the test.fzz file and Aisler produced a rendering of a board with a large square cut out. So i would say your board works unless this is not what they are supposed to look like.

Thanks @sublimeartistry that is what it should look like.
Strange that seeedstudio fusion PCB is not rendering it like this, maybe they do not support cutouts like this.
I will contact them, but now I know that it is not me :wink:
Thanks again!

Hi,

I don’t know if anyone can help me with this - it’s been driving me nuts for a few days now, and similar to Andy’s donut problem.

When importing this svg, I get the no cutouts detected message. Here’s roughly what it should look like…

…I’ve tried everything in this thread, plus this…both several times. I’m honestly just considering a drill and a hacksaw at this stage!

If anyone can see what’s wrong with the xml, it’d be much appreciated.

Cheers

Rich

Try this one instead. From looking at the format of andys_donut above I think your grouping is wrong and you need two paths (I duplicated the original path for the second one).

Note this has the same file name as your current one, so you probably want to rename it to something new to compare the two. If not perhaps someone that actually knows what they are doing will comment :slight_smile: .

Peter

Your board does not have any cutouts so it says it has no cutouts. Your board is just an outline and it appears to work as expected.

Aisler (Fritzing Fab) shows this as the outline.

Hi Peter,

I was just about to ask whether you had a link to the actual svg, but I think sublimeartistry (below) has answered already…and it is VERY embarrassing…

Thanks anyway!

Rich

:flushed: …well this is a bit embarrasing…I’d assumed that due to the way I’d created the shape (using difference in inkscape), the notches in the corners etc should be interpreted as cutouts in fritzing.

I’ve never been so happy to discover what an idiot I’ve been though!

Cheers

Rich

The svg is there, to down load it you need to right click it and save tmage as. The forum renders svg files (sometimes it can’t though).

Peter