Comments (10)
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.
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.
Yes, it might be better to create a new branch if we need to work on this.
Thanks for the work !
from jlc2kicad_lib.
I've pushed the workaround to a branch in my fork. https://github.com/Xyntexx/JLC2KiCad_lib/tree/Pad__center
from jlc2kicad_lib.
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.
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.
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.
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.
That's a lot of stuff done, thank you !
I will try to test everything today.
from jlc2kicad_lib.
merged in 12c6860
from jlc2kicad_lib.
Related Issues (20)
- Deleted
- Arc conversion error
- Component OBJ/STEP file HOT 1
- Create vias using THT pads HOT 2
- Cannot connect symbol pins HOT 3
- Kicad plugin HOT 3
- Issue with STEP and rotation / translation HOT 5
- FR: Run this code for all parts and make a library available for download somewhere.
- Micro-USB Footprint: THT elements are missing in the footprint HOT 2
- Incorrect pin assignment when importing component C12087 HOT 3
- USB-C missing oval pin hole HOT 1
- Symbol labels missing when importing part C150858 HOT 4
- Windows 10, KiCad 7, Cannot Follow Instructions To Plugin Success , KicadModTree Not Sure. HOT 2
- Z-Level of footprint HOT 1
- Kicad Symbol has misplaced geometry HOT 2
- GUI available
- Incorrect link to datasheet in generated kicad_sym HOT 1
- Feature Request: Prefix Symbol, Footprint and 3D Model with LCSC number HOT 1
- Error During Install, system cannot find...futurize.exe.deleteme HOT 1
- Footprint add manufacturer and part name field
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jlc2kicad_lib.