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

Gerber export #11

Closed kr15h closed 1 year ago

kr15h commented 1 year ago

I started looking into the gerber export issue and I see that at this point there is basic functionality that exports

It is possible to open them up in KiCad gerber viewer, but if they appear in the way they are expected to appear is another question.

However, it seems that gerber format has many options and that the functionality itself would benefit from having an export options dialog. Maybe we can use this issue to synchronize on the matter. What comes to my mind first is to look at the KiCad gerber export panel and see what could be the bare minimum of options that one could have in order to be able to generate files for, say, three board houses such as

kr15h commented 1 year ago

Another thing is that at my lab we use CopperPCB software that supports Gerber X2 format where the drill files are gbr files as well and it would be really nice if it would be able to export those, of course.

leomcelroy commented 1 year ago

A good objective with this would be to be able to design a Modular Thing in SVG-PCB and order it from a board house without compromises. To do that we would need some other features too. Specifically

Focusing on the gerber export. Right now it doesn't export all layers of the board design. Something else that is a bit weird is because all the shapes are polylines holes have to be inferred and derived. But that seems to work okay.

kr15h commented 1 year ago

I started playing around with it and got a modal showing up with options. One set of options is the layer selector and I wonder which structure would be best to use for layers. Is there a built-in set of layers? Are the layers added via code? Does the layer naming convention make sense?

If we look from KiCad perspective, it would make sense to have a few built-in layers at this point:

Should we hard-code these layers in global state? How?

kr15h commented 1 year ago

I will submit a pull request with initial demo and we can continue the discussion there.

leomcelroy commented 1 year ago

Quentin and I made a board to test the Gerber export. It's a huge improvement! A couple things came up.

One is we want to verify that the thru-holes are actually plated?

Two is that the back solder mask doesn't get generated.

Screen Shot 2023-03-29 at 10 12 13 AM

Three is that vias also have holes, which they probably shouldn't. Seen in the stray hole interspersed with the stepsticks below.

Screen Shot 2023-03-29 at 10 12 04 AM

leomcelroy commented 1 year ago

On closer evaluation the the back solder mask issue may be the JLCPCB gerber viewer.

kr15h commented 1 year ago

I was using the KiCad Gerber viewer to validate. I also did some testing with JLCPCB, PcbWay and Seeed. They have different viewers and all of them seem buggy in one way or another. But yeah, I am excited too. I came up with some ideas on what classes/datatypes one would need to make the exporting thing easier. Also at this point I feel that basic KiCad export could be something I could do to validate what we talked about earlier.