Coder Social home page Coder Social logo

Comments (10)

TousstNicolas avatar TousstNicolas commented on September 17, 2024

Is it also the case with footprints not created by my script ?
I found an issue that seems similar : Bouni/kicad-jlcpcb-tools#143
Looks like it might be an issue that come from the way JLC handles the kicad footprints, and does not come from how the footprint is generated.

I will try to get deeper in the issue when I have more time.

from jlc2kicad_lib.

Xyntexx avatar Xyntexx commented on September 17, 2024

I think I've created a working workaround where I search for the middle point of the pads. Should we create a branch for this?

from jlc2kicad_lib.

TousstNicolas avatar TousstNicolas commented on September 17, 2024

Yes, it might be better to create a new branch if we need to work on this.
Thanks for the work !

from jlc2kicad_lib.

Xyntexx avatar Xyntexx commented on September 17, 2024

I've pushed the workaround to a branch in my fork. https://github.com/Xyntexx/JLC2KiCad_lib/tree/Pad__center

from jlc2kicad_lib.

TousstNicolas avatar TousstNicolas commented on September 17, 2024

So based on your changes, if I understand correctly, the issue was that JLCPCB only takes into account the pads when centering the component while I also took other parts ?

Are there any cases where a footprints does not have any pads ? I don't recall ever encountering this case. It might be too much to keep track of the positions of the pads only, and every other parts in the footprint_info class.

It also seems to bring issues with the 3D models centering, check with component C698918 for example where the X axis is not right (while correct with the current version).

Also, can you try to use black to format your code and keep it consistent with the rest.

As always, a big thanks for your work !

from jlc2kicad_lib.

Xyntexx avatar Xyntexx commented on September 17, 2024

Is there any reason not to use the origin coordinates for the translation provided in the footprint data?
x and y from the data from C698918

{
  "head": {
    "docType": "4",
    "editorVersion": "6.5.22",
    "c_para": {
      "package": "DO-218AB_L13.5-W8.4-LS15.5-FD",
      "pre": "D?",
      "Contributor": "lcsc",
      "link": "https://item.szlcsc.com/296833.html",
      "3DModel": "DO-218AB_L13.5-W8.4-LS15.5-FD"
    },
    "hasIdFlag": true,
    "x": 4032.4,
    "y": 3000.5,
    "utime": 1626858189,
    "uuid": "aa4c8bfeca62411b90acab80a9905e2f",
    "importFlag": 0,
    "transformList": ""

from jlc2kicad_lib.

TousstNicolas avatar TousstNicolas commented on September 17, 2024

It's been a long time since I did this part, but from what I remember, These data where not matching the expected offset.

from jlc2kicad_lib.

Xyntexx avatar Xyntexx commented on September 17, 2024

I've updated the https://github.com/Xyntexx/JLC2KiCad_lib/tree/Pad__center branch and used the origin coordinates provided in the data to keep the origin of the part where it's intended.
The main reason for me is to keep the footprint compatible with JLCPCB assemble service part origins.

Apparently, EasyEDA automatically uses the middle of the 3d model and places it flat on the board regardless of the origin of the 3d model. Kicad uses the origin of the 3d model as the reference. With a few extra lines, we can calculate the midpoint of the 3d model and translate the 3d model accordingly.
3D-model alignment should even improve when using this method.

It seems to work for me but let me know if you find some problems.

I added a black formatting GitHub action to my main branch just to test it. That might be a good way to make sure the contributed code is on par with the repository requirements. It can even make a commit or a pull request with the correctly formatted code. 😉

from jlc2kicad_lib.

TousstNicolas avatar TousstNicolas commented on September 17, 2024

That's a lot of stuff done, thank you !

I will try to test everything today.

from jlc2kicad_lib.

TousstNicolas avatar TousstNicolas commented on September 17, 2024

merged in 12c6860

from jlc2kicad_lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.