Gerber in linux kicad

Since there is no function for editing a gerber file, a question has appeared in the kicad. How can I edit a gerber file in Linux environment? There are applications for win both paid and free on Linux 0 … All I found was converting gerbers to other formats like svg but there is no direct editing … Maybe there is a way to work with this format directly avoiding cornverting ? The task is quite simple, for example, change the square to an oval … In the wine environment, this is done by replacing the primitive with one button

It’s just a text file. Use a text editor to make simple changes like swapping apertures.

2 Likes

gerbv

gEDA project

not so uptodate as kicad gerber viewer, but it can allow an editing

1 Like

Unfortunately, he can’t edit from, only the complete removal of the aperture is possible

I was just experimenting a bit with gerbv while you posted that.
The only editing function I could find was to delete objects.
And the Geda project confirms that:

When built using Cairo, gerbv allows for limited Gerber editing. (Currently limited to object deletion.)

Source: http://gerbv.geda-project.org/

The “archive” at the bottom of that page also stops in 2011, so no updates for 12 years.

Yes, you can open it in a text editor, but how to change the form? I see a bunch of numbers and what to change there and what is not clear

You can ask for support there… source code available

I applied but there are only 2 developers and they cannot

Here is an example of how to make a rectangle from this flat in Linux

It’s probably better to take a step back.
Just leave the gerber viewer as a viewer, to check things before you send the files to a fab.
If there is any problem in the gerbers, it is very likely it is better to fix it in the PCB editor and then create a new set of Gerbers (that is just a few mouse clicks).

The combination of PCB and Footprint editors make KiCad quite capable of all sorts of edits.

On top of that. You can also export a set of Gerber files into a PCB project. This is still a conversion, it it is a viable option. I wrote an FAQ article about this some time ago:

Yes, yes, I’m reading your article, but I have very often the need for editing, while there is no board file and only gerbers are available … I understand that you can convert gerbers to the board editor and assign a footprint there or draw everything again, but this not replacing a rectangle with a square…

For a month of researching this topic, I found a small code, but I don’t know how it works and how to assemble it) apparently like the author … Of course, you can install a virtual machine with win, but this is not what I wanted to change a circle to a square) https:/ /github.com/tobiasvogel/GerberStencilGenerator

Your example is also not so straight forward as it seems.
You can change the copper layer, but that still leaves the solder mask, solder stencil and maybe other layers. It is very easy to make mistakes with that workflow, and that is a good reason to avoid it as much as possible.
And when you make new gerber files, it gets overwritten and all your work is lost.

So this is an excellent example of something you should not do.

In KiCad:

  1. PCB Editor: Select the footprint and press [Ctrl + e] to load it in the footprint editor.
  2. Set that pad to the same as the other pads.
  3. Close the footprint editor. (It will prompt you whether to save the changes to the PCB.

Doing it this way ensures integrity of the project.

Yes, that is true, but I came to the conclusion that just deleting the back-imported pads and replacing them with brand new footprints is so quick and easy, that it is a good alternative. If you have some old project, then either leave it as it is (apparently it was good enough the first time), or get ready to spend some time to fix it properly. Once you’ve familiar with the workflow I described there, such a thing can be done quite quickly.

I am not aware of a reasonable gerber editor for Linux. Linux is unfortunately still a niche OS on the desktop part with just a few percent market share. Desktop use overall is also on a declining path for quite some years, only that virus thing of a few years back forced a lot of people to work from home and that was a big peak in PC sales, but I guess very likely declining again.

With Linux you have to choose your battles. For example if you want to buy a new oscilloscope that also interfaces with your PC, then you have to choose carefully. I’m running Linux for about 10 years now, and it’s not out of practicality but out of idealism and because I’m appalled by how those big software companies treat their customers.

Another question about non-clicks… If you put a gerber in a board file, it turns into a polygon and not into footprints… The only way is to add a new footprint and generate a gerber ?

You are absolutely right when it comes to a project or multiple layers or a project in my case it is usually one layer of aperture paste here for an example of how it looks in altium there are many more editors but they are all under win

The concept of a “footprint” does not exist in a Gerber file. In Gerber files there are just “D-codes” which act as a sort of postage stamp. You create a shape, and then you stamp that shape all over the PCB.
There is some smart software (on other platforms) that tries to guess what D-codes belong to a footprint by analyzing layers in a set of gerber files (The latest X3 Gerber variant MAY have more info). KiCad does not do guesswork in that direction, and it just converts what is in the gerber files to the closest thing that works in a PCB project.

If you only want to change some small details, you can probably omit the footprint replacement part and just edit the copper polygons directly in the PCB Editor, and then export to Gerbers again. I have not tried this myself though, so you have to check if this works for you yourself.

Also, If you want to omit the double conversion and use a text editor…
You can use KiCad’s gerber viewer to both search for the D-codes, and their locations.
For example, the Highlighted pad has D-code 13, and is at coordinates (3750, -4500). Look for that in the status area at the bottom of the screenshot.

You can search for those numbers in the text file and then fiddle a bit with the D codes to replace it with another D code.

Overall, the principles in Gerber files are quite straightforward, and the Gerber specification is freely downloadable from Ucamco (which is the creator and maintainer of the Gerber format).

Why do you want to edit the Gerber?

In the wine environment, this is done by replacing the primitive with one button

What is the wine environment, and why are you relating it to editing Gerber files?

Since you are posting in the Kicad forum, you can edit the Kicad PCB, and then export a new Gerber. Gerber is like a PDF, or a compiled program. While it is possible to edit, it is better/easier to edit the source files instead.

Your main question here seems too vague and not even in the right forum. Since Kicad does not have a Gerber editor. It has a Gerber viewer, as evince is a PDF viewer, not an editor.

1 Like

I checked in kicad, it recognizes it as a polygon without the possibility of editing the shape … It’s like converting gerber to svg and opening it in inscape … If it’s even simpler, then there is no way to replace one primitive with another … The only option left is to add a new one footprint to the right places and re-generate gerbers … In general, it’s surprising that a relatively simple text format is so difficult to edit on Linux)
Yes, I see d13 in the text editor, but how can I find out the shape? If they add the same, then I can copy from a copy, but if they are different? Or is she just one of a kind?

In the post above, I gave an example with pictures of why I need to edit and for what … This is roughly the question of why do I need a gerber editor? If you are familiar with the technology of electronics production, then I think the answer is obvious … On this forum, due to the lack of other options for Linux …