Bouni / kicad-jlcpcb-tools

Plugin to generate BOM + CPL files for JLCPCB, assigning LCSC part numbers directly from the plugin, query the JLCPCB parts database, lookup datasheets and much more.
MIT License
1.19k stars 108 forks source link

Occasional components shift / FP anchor not honored? #391

Closed thisisgregm closed 4 months ago

thisisgregm commented 11 months ago

Describe the bug Inconsistent / random components shift, especially non-standard ones like connectors, etc. Seems like the plugin doesn't honour a footprint anchor (moving an anchor in FP editor, then updating footprints generate the same CPL file while updated footprints should have different components placing than before.

To Reproduce Steps to reproduce the behavior:

  1. Download JLC footprint using this tool: https://github.com/TousstNicolas/JLC2KiCad_lib
  2. Import to KiCAD library
  3. After uploading production files generated using this plugin some components (noticed that for connectors: Micro-USB C2682229 and DC barrel connector C720557) the JLC preview shows the components shifted as shown below (in both examples below J1 is my custom FP, J2 is FP supplied by JLC).
  4. I experimented with various FP positions and seems like that doesn't change anything in generated CPL files, so possibly anchor position is not honored by the plugin on certain (unusually shaped?) footprints.

image

image

Expected behavior A correct components position in CPL file.

KiCad Version

Below version info from my work machine, but the same also happens on 7.0.9 on Linux at home.
The plugin version: 2023.09.01 (latest as of today)

Application: KiCad x64 on x64

Version: 7.0.9, release build

Libraries:
    wxWidgets 3.2.3
    FreeType 2.12.1
    HarfBuzz 8.2.1
    FontConfig 2.14.2
    libcurl/8.4.0-DEV Schannel zlib/1.3

Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
    Date: Nov  5 2023 19:26:40
    wxWidgets: 3.2.3 (wchar_t,wx containers)
    Boost: 1.83.0
    OCC: 7.7.1
    Curl: 8.4.0-DEV
    ngspice: 41
    Compiler: Visual C++ 1936 without C++ ABI

Build settings:
    KICAD_SPICE=ON
thisisgregm commented 11 months ago

Forgot to mention, but generating .pos file directly from KiCAD (File > Fabrication Outputs > Component Placement) changes the component positions after modyfing FP anchor. So the behavior of built-in KiCAD tools is correct.

Bouni commented 10 months ago

Can you please test again, I just merged PR #381 which might fix this issue.

dzid26 commented 10 months ago

I think #381 will not fix anchor placement issue. I was contemplating about this here https://github.com/Bouni/kicad-jlcpcb-tools/issues/379#issuecomment-1780941425. I still think, having dedicated JLC part offset setting would be better than anchor manipulation.

However #381 may fix thru-hole component placement, because now it ignores silkscreen when finding center of the component.

Bouni commented 4 months ago

I just tried to reproduce this, my results are not 100% correct but seem to be better than yours:

grafik

The problem is that we don't know for each part what offsets JLC uses, so thats a game of cat and mouse which we will never be able to win.

As this does not mean the board is manufactured wrong, I'll close this as I can not do much about it.

If somebody comes up with a smart idea on how to fix this, re-open or create a new issue or even better a PR!