leomcelroy / svg-pcb

Design PCBs in the Browser
https://www.leomcelroy.com/svg-pcb-website
GNU General Public License v3.0
64 stars 9 forks source link

Add direct mapping between design layers and gerber export layers #63

Closed kr15h closed 9 months ago

kr15h commented 11 months ago

Adding direct mapping of design layers to Gerber export (Issue #59)

kr15h commented 11 months ago

This works, but is a bit awkward. There are a few questions/problems to be discussed/sloved.

Gerber files need functionality information. Is it a front copper layer or a mask? Is it an outline? Currently there is no other way to tell that, except by guessing by name. There is no separate layer for masks in SvgPcb. What is being done now is that layer masks are generated with the corresponding copper layers. Same goes with drills. Drills are not in the layer list, thus I just export them always.

One way this could be dealt with is to have the option to specify the layer function in the Gerber Export modal. There would be some hard coded options there. For basic things this could be guessed (F.Cu is Front Copper of course, or interior is Outline), but still a solid list of Gerber layer functions could be there.

Then, with solder masks, maybe it would make sense to add the solder mask layers to the design in order for them to be exported. Then they would show up in the Gerber Export modal and the user could choose the Gerber layer function as well as if it is exported at all.

kr15h commented 11 months ago

Anyways it seems that I found a possible solution by talking to myself via previous comment.

  1. I will hardcode some of the Gerber FileFunctions (see Gerber spec 5.6.3) to be assigned to the exported layers.
  2. I will expect the user to add F.Mask and B.Mask layers to design in order for them to be exported.
  3. I will separate drills from layers by adding another checkbox "export drills" or similar.
kr15h commented 11 months ago

On the other hand, this could be done in a similar way as with KiCad meta data as we discussed. This would reduce the amount of effort needed to develop a special GUI for the modal then. Let's see...

kr15h commented 9 months ago

The branch name tells that it is kicad download that I am fixing, but it is gerber download for now. Will open a new PR.