Tracing the silkscreen with FlatCAM

The most common task when preparing a prototype PCB is generating isolation routing, this is, cutting around the traces for electrical isolation. A not so common task is somehow cutting inside shapes, just following lines. Such task could be useful for engraving the silkscreen (text and lines) into the copper.

Starting with version 7, FlatCAM supports tracing Gerber layers. Let’s dive straight into an example:

The image below shows an example PCB generated from an online program easyeda.com. Layers shown are bottom (GBL) and top (GTL) copper, board cutout (GKO), and silkscreen (GTO).

tracing_example1

 

The objective here is to trace the silkscreen. We want to finally obtain g-code that will cut inside/along the lines. We will do this using the FlatCAM Shell. You can open it through the menu Tool→Command Line:

shell

We need to open the desired layer specifying that we want to trace (or follow) the path in the Gerber file, and not to create polygons from it. This has to be done at the time the file is parsed, so we need to open a different copy. Let’s look at the open_gerber command:

> help open_gerber
Opens a Gerber file.
   > open_gerber <filename> [-follow <0|1>] [-outname <o>]
      filename: Path to file to open.
      follow: If 1, does not create polygons, just follows the gerber path.
      outname: Name of the created gerber object.

To enable following/tracing we must set the follow option to 1. Here’s how we open the file:

> cd: C:/path/to/files
> open_gerber GTO -follow 1 -outname GTO_follow

Nothing new should appear on the screen because no polygons were created but the new object GTO_follow should be in the Project list.

Now let’s create some geometry we can see and use to create a CNC Job. This is done with the follow command:

> follow GTO_follow -outname silk_geo

Another object with name silk_geo should be in the list. If we hide all objects except GKO (green) and silk_geo (red) we should see the following:

tracing_example2

Compare this to the first window shown in this article. Notice that the inner large circle resulted in two red circles. This is because that circle in the Gerber was not defined as a path but probably as a polygon.

The final step is to create a CNC Job from this new geometry and export G-Code. You can do this in the GUI by double-clicking the silk_geo object, entering the desired parameters and clicking Generate in the Create CNC Job section. This will create an object named silk_geo_cnc and is shown in the screenshot below.

tracing_example3We can do this in the shell too. To create the CNC Job:

> cncjob silk_geo

To finally create the g-code in the file silk.gcode:

> write_gcode silk_geo_cnc silk.gcode

Of course these commands have additional parameters you can control. You can look them up in the manual or by typing help in the shell.

You can use the g-code you’ve just generate to cut into the copper to label your parts, add a custom logo or perform arbitrary cuts onto your board. But don’t limit yourself to engraving! You can use a permanent marker to write on your boards too or even use a laser source for this purpose.

 

  • http://flatcam.org Juan Pablo Caram

    Hi. Testing comments.

  • bill gertz

    Hey Juan,

    Thanks for the article it was useful not only for cutting the silk screen into the board but for cutting out a specialty board with a PCB-USB connector. In our case we treated it as an iso cut but specifying a cut out bit with a depth sufficient to cut out the board.

    Thanks!

  • bill gertz

    Juan,

    Looked at the article you suggested but we had a crazy rocket ship “shape” to cut out. The silkscreen article was actually more appropriate as we traced a line that was imported into Eagle before turning the .brd into a gerber file.

    Thanks for suggesting the other article though!

  • David

    First of all: Thank you for this great program. It is very powerful.
    I am trying to sensitize negative dry film with a 405 nm laser and my cnc.
    I would like the track of the gerber tracks to be traversed by the laser giving as many passes as necessary to complete the width of the track and draw the pads completely. I have seen that the post of drawing serigraphy is very close.
    Does Juan Pablo consider it interesting that FlatCAM does this work?
    If so, I would like you to tell me when you are planning to do so.
    If you need help I could collaborate on its implementation, although I do not know much about python. But everything is learned! By the way, I’m from Spain. You speak Spanish?
    Regards, and thank you very much
    David Sandoval

  • Graciano Romero

    It took a few min to figure the CMD line and how it functions in flatcam in windows 10.
    it would be nice if this was sampled in the manual. but over all it is an awesome program to with.

  • Curtis Newton

    why the command lines ? you can do that with the giu

  • Mark Schuurman

    Thank you, exactly what I was looking for!

  • Mark Schuurman

    …only now I’m looking for a way to edit the silkscreen. I have a couple of 0603 leds and I want to eliminate the symbols on the PCB in the silkscreen generated by EasyEDA. Th elaser blows away too much isolation…

  • Hej rup

    Thank you, exactly what I was looking for!

  • Daniel Frolich

    I am running ver 8.5 and can not enter ANY data in the command line…what am I doing wrong?

  • Jostikas

    Hi!
    Is there a similar way to paint copper areas (instead of painting non-copper) in 8.5? Useful for milling off soldermask from pads.