TousstNicolas / JLC2KiCad_lib

JLC2KICAD_lib is a python script that generate a component library (schematic, footprint and 3D model ) for KiCad from the JLCPCB/easyEDA library.
MIT License
228 stars 42 forks source link

Add check for oval pad holes in rectangle TH pads #32

Closed Xyntexx closed 1 year ago

Xyntexx commented 1 year ago

Issue: oval pad holes not recognized. Solution: data[11] seems to carry to the length of the hole

Tested only using C13453 so some more testing required that I didn't have time to do.

Before: kicad_2023-01-16_22-25-41

Same in EasyEDA: image

After: image

Also, the connector shape rectangle is drawn filled for some reason. Maybe we need to recognize if the rectangle is filled and use KicadModTree.nodes.specialized.RectLine?

Here is some example data: Filled: "RECT~3985.87~2984~28~17~3~gge45~0~0~~~~", Not filled: "RECT~3985.87~2984~28~17~3~gge45~0~1~none~~~",

TousstNicolas commented 1 year ago

Thanks for your PR, I will try to test it tomorrow if I have time.

TousstNicolas commented 1 year ago

I corrected the if statement, as the data[11] is a string, in needed to be cast to int to be compared to 0. I checked on a few other components that uses oval pad holes, and it works as expected.

It would be great if in the future, before pushing, you could double-check your code formatting to ensure it follows the project's guidelines. I personally use Black for code formatting, and I think it would be helpful for you to use it as well for future contributions. (I don't have clear contributions guidelines on this repo , so in this case, this is my fault).

Thank you again for your work ! ;)

TousstNicolas commented 1 year ago

Also, the connector shape rectangle is drawn filled for some reason. Maybe we need to recognize if the rectangle is filled and use KicadModTree.nodes.specialized.RectLine?

Here is some example data: Filled: "RECT~3985.87~2984~28~17~3~gge45~0~0~~~~", Not filled: "RECT~3985.87~2984~28~17~3~gge45~0~1~none~~~",

Do you have an example of a component with a filled rectangle ? I looked at tens of components with rectangles, none of them were filled :/

Xyntexx commented 1 year ago

For example: C13453 C6649

I fixed this in a commit that ended up also in the my_ARC_fixes branch by accident. So this should also be fixed now. You can revert to an earlier version to test the difference.

TousstNicolas commented 1 year ago

Yes indeed, I didn't noticed it. Both C13453 and C6649 only have unfilled rectangles, I am trying to find a component with filled rectangles to check both cases.

Plus, this is something I did wrong from the beginning, but KicadModTree has RectFill to handle the filled Rectangle instead of using Polygon. Even so it works with it, I will clean this.

Xyntexx commented 1 year ago

Oh sorry I misread. No I haven't seen a filled rectangle in the library. I used the easyEDA footprint editor to check the code but there is no way to import them.

TousstNicolas commented 1 year ago

Well, I am 700 components in, without any filled rectangles yet. I will let it run during the night to see if it finds one. In the meantime, I will consider you are right and keep this change. It shouldn't cause any issue.