Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCB cutout not included #41

Open
ReinBentdal opened this issue Mar 19, 2023 · 3 comments
Open

PCB cutout not included #41

ReinBentdal opened this issue Mar 19, 2023 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ReinBentdal
Copy link

Describe the bug
PCB cutout not included when creating footprint

To Reproduce
Steps to reproduce the behavior:

  1. Load part C559118 in EasyEDA, use 3D viewer to see a cutout in the part
  2. Create footprint with this lib, and load into KiCad. There is no hole

Expected behavior
I would expect the lib to also be able to include cutouts in the parts

Screenshots
EasyEDA:
image

KiCad:
image

@Trajelectory
Copy link

i'm not sure it's an issue with this script but with Kicad himself.

@TousstNicolas
Copy link
Owner

TousstNicolas commented Mar 25, 2023

Hi, thanks for reporting this.

It is indeed missing as EasyEDA consider the cutout as not just a regular shape on the Edge.Cuts layer, but as a solidregion which was not handled.

I added a handler for the simple polygons cutouts, unfortunately I do not have the time to look deeper into it and try to understand the logic of how EasyEDA parse the more complex shapes.

The polygons function correctly once they are placed on a board, but the 3D preview may not display correctly in some instances. I am unsure of the reason for this issue :

footprint 3D preview :
image

PCBnew 3D viewer :
image

Help would be greatly appreciated to handle more complex shapes and solve the previous issue.
The component C2687297 contains shapes that can be used to work on this.

If you want to help, the current handler can be found in the footprint handler file :

matches = re.findall(
r"(?:M|L)\s+([-+]?\d*\.?\d+)\s+([-+]?\d*\.?\d+)", data[1]
)
# convert the list of numbers to a list of tuples with x, y coordinates
points = [(mil2mm(m[0]), mil2mm(m[1])) for m in matches]
# appends nods to footprint
kicad_mod.append(Polygon(nodes=points, layer="Edge.Cuts"))

@TousstNicolas TousstNicolas added enhancement New feature or request help wanted Extra attention is needed labels Mar 25, 2023
@ReinBentdal
Copy link
Author

Thanks for you effort! I will check out the new version when I have time. Maybe if I have time in the future, and feel the need, I will investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants