wokwi / easyeda2kicad

Convert EasyEDA designs to KiCad EDA
https://wokwi.com/tools/easyeda2kicad
Other
287 stars 39 forks source link

Mounting holes are not present after conversion #21

Closed mtiutiu closed 4 years ago

mtiutiu commented 4 years ago

Description: Mounting holes are not present after converting a board from EasyEDA to KiCAD.

Expected result: Mounting holes should be present after conversion.

See attached pictures.

Original: pcb_bottom

After conversion: Screenshot from 2020-02-05 15-18-36

Project files:

project.zip

KiCAD version (latest stable): 5.1.5 easyeda2kicad version: 1.4.1

If any other details are needed please let me know. Thanks.

urish commented 4 years ago

Does KiCad have a tool for creating holes?

As far as I can tell, there are two indirect ways to achieve this:

  1. Add a circle in the Edge.Cuts layer
  2. Create a footprint with a pad that has a hole size that equals the size of the pad

But perhaps I missed something?

mtiutiu commented 4 years ago

@urish No it doesn't have a direct way of doing it. Usually you accomplish this via a designated mounting hole footprint (there is a dedicated library in KiCAD).

urish commented 4 years ago

@mtiutiu we can't really use the dedicated footprint, as the holes can be of any diameter, so we'd have to either use a circle in the Edge.Cuts layer, or wrap the holes in a footprint.

Another option would be to open a feature request for KiCad to add support for standalone holes. Do you happen to know some of the developers who work on KiCad? perhaps they can point us at the right direction

mtiutiu commented 4 years ago

I haven't used KiCAD for some time now but that was the only option I knew of. Maybe things changed meanwhile I'm not sure. The best place to ask for questions is on their main forum . All the developers listen there.

mtiutiu commented 4 years ago

@urish Ok I found the block that needs to created in the kicad pcb file source in order to generate a hole.

(module MountingHole:MountingHole_1.5mm (layer F.Cu) (tedit 5E3BC186) (tstamp 5E3B09EF)
    (at 109.982 78.232)
    (descr "Mounting Hole 1.5mm, no annular")
    (tags "mounting hole 1.5mm no annular")
    (attr virtual)
    (fp_text reference "" (at 0 0) (layer F.SilkS)
      (effects (font (size 1.27 1.27) (thickness 0.15)))
    )
    (fp_text value "" (at 0 0) (layer F.SilkS)
      (effects (font (size 1.27 1.27) (thickness 0.15)))
    )
    (pad "" np_thru_hole circle (at 0 0) (size 1.5 1.5) (drill 1.5) (layers *.Cu *.Mask))
  )

In my case it's a 1.5mm hole. As I see above everything can be generated pretty easy I guess as it follows a pattern.

What's left to be determined is the coordinates which is this attribute (at 109.982 78.232). There are two more attributes like (tedit 5E3BC186) and (tstamp 5E3B09EF) one is the timestamp when it was placed on the board I assume and the other one I can't figure out now what it really means - maybe the last time when it was edited on the board??. Other than that I don't see an issue creating the required fields as they follow the same pattern.

Oh and I know that the above block represents a module but it can be created on the fly like this on the board - it won't complain. I'm saying this because the 1.5mm mounting hole module doesn't exist in the library at all (I just edited the KiCAD source file by observing the pattern they use behind the scenes).

Did I missed something? Thanks.

mtiutiu commented 4 years ago

The hole diameter is set here (pad "" np_thru_hole circle (at 0 0) (size 1.5 1.5) (drill 1.5) (layers *.Cu *.Mask)). The rest is just metadata so to speak. The most important atrributes are (size 1.5 1.5) (drill 1.5).

So the above module generates a NPTH hole. For plated holes I need to search what it looks like. But I don't remember if EasyEDA has plated holes or if and how can be generated. I'm saying this because the above module block may need to be generalized to support both types.

urish commented 4 years ago

Thanks for looking into this @mtiutiu !

Seems like the holes in EasyEDA are only NPTH:

image

(source)

Let me see what I can do with your findings

mtiutiu commented 4 years ago

@urish

I just tested with latest master code as it is right now and it seems to work. Yaay!

See here: Screenshot from 2020-02-06 12-34-25

urish commented 4 years ago

Lovely, I will release shortly. Can we close this issue then?

mtiutiu commented 4 years ago

Lovely, I will release shortly. Can we close this issue then?

Yep, seems like this one can be closed now.

urish commented 4 years ago

Released as part of 1.5.0