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

Minor symbol issues and 3D model offset [LCSC C393942] #25

Closed
Bouni opened this issue Apr 26, 2022 · 12 comments
Closed

Minor symbol issues and 3D model offset [LCSC C393942] #25

Bouni opened this issue Apr 26, 2022 · 12 comments
Labels
bug Something isn't working

Comments

@Bouni
Copy link
Contributor

Bouni commented Apr 26, 2022

Hi,

first of all, wonderful tool 🤩

Added this switch:
grafik

Thats the result in the Schematic:
grafik

This is what esyEDA gives me:
grafik

The footprint looks good apart from minor artifacts:
grafik

The 3D model is offset in Y and Z:
grafik

@uPesy
Copy link
Owner

uPesy commented Apr 30, 2022

Thanks for pointing out these issues.
For the schematic, it's the 22 ?
For the footprint, these dots are actually also on the easyeda footprint
image
I think it's for orientation.
For the 3D model, i know that there are issue offset on some 3D model, but i have not find wet a formula to fix the offset that works on all components.
I will try to fix that when i have time.

@uPesy uPesy added the bug Something isn't working label Apr 30, 2022
@Bouni
Copy link
Contributor Author

Bouni commented May 4, 2022

I might stumbled upon something helpful!
If I use easyeda and add LCSC Part C393942, then in the PCB I click on the 3D Model text in the Properties sidebar SW-SMD_TS24CA I get a 3D viewer where I can see offsets:

image

The data from the json ["packageDetail"]["dataStr"]["shape"] -> SVGNODE is:

{
    "gId": "g1_outline",
    "nodeName": "g",
    "nodeType": 1,
    "layerid": "19",
    "attrs": {
        "c_width": "17.9134",
        "c_height": "14.1732",
        "c_rotation": "0,0,0",
        "z": "-1.5748",
        "c_origin": "3999.7563,2998.6197",
        "uuid": "739232e7e2bb4235a1eea61c76b19f50",
        "c_etype": "outline3D",
        "id": "g1_outline",
        "title": "SW-SMD_TS24CA",
        "layerid": "19",
        "transform": "scale(1) translate(0, 0)"
    },
    "childNodes": [
        {
            "gId": "g1_outline_line0",
            "nodeName": "polyline",
            "nodeType": 1,
            "attrs": {
                "fill": "none",
                "id": "g1_outline_line0",
                "c_shapetype": "line",
                "points": "3990.7997 2996.2575 3990.7997 2996.6512 3990.8784 2996.6512 3990.7997 2996.8481 3990.7997 2997.0449 3990.7997 3000.1945 3991.1934 3000.1945 3991.1934 2997.0449 3991.1934 2996.9268 3991.2327 2996.8481 3991.2721 2996.7693 3991.2721 2997.8717 3991.2721 3001.0607 3991.2721 3001.2181 3991.2721 3001.2575 3991.2721 3003.1079 3991.2721 3003.7378 3991.2721 3005.3126 3991.9808 3005.3126 3992.2563 3005.3126 3992.2563 3005.5882 3992.2563 3005.7063 3993.8311 3005.7063 3993.8311 3005.5882 3993.8311 3005.3126 3994.4217 3005.3126 3997.8863 3005.3126 3998.1618 3005.3126 3998.1618 3004.5252 3999.3036 3004.5252 4000.3666 3004.5252 4001.3114 3004.5252 4001.3114 3005.3126 4001.3508 3005.3126 4002.3744 3005.3126 4003.5949 3005.3126 4005.0516 3005.3126 4005.6421 3005.3126 4005.6421 3005.5882 4005.6421 3005.7063 4007.2169 3005.7063 4007.2169 3005.5882 4007.2169 3005.3126 4007.5319 3005.3126 4008.2012 3005.3126 4008.2012 3003.7378 4008.2012 3003.1079 4008.2012 3001.2575 4008.2012 3001.2181 4008.2012 3001.0607 4008.2012 2997.8717 4008.2012 2996.7693 4008.2406 2996.8481 4008.2799 2996.9268 4008.2799 2997.0449 4008.2799 3000.1945 4008.713 3000.1945 4008.713 2997.0449 4008.6736 2996.8481 4008.5949 2996.6512 4008.713 2996.6512 4008.713 2996.2575 4008.1225 2996.2575 4007.9256 2996.2575 4007.5319 2996.2575 4007.2169 2996.2575 4007.1382 2995.4701 4006.1146 2995.4701 4006.0358 2996.2575 4003.6736 2996.2575 4003.0437 2991.8481 4003.0437 2991.7693 4003.0044 2991.6906 4002.9256 2991.6119 4002.8862 2991.5725 4002.8075 2991.5725 4002.7681 2991.5331 4002.8469 2991.5725 4002.8075 2991.5725 4002.7288 2991.5331 4002.7681 2991.5331 4002.8075 2991.5725 4002.7681 2991.5725 4002.7288 2991.5331 4002.8075 2991.5725 4002.8075 2991.6119 4002.7681 2991.5725 4002.8075 2991.5725 4002.8469 2991.6119 4002.8075 2991.6119 4002.8075 2991.5725 4002.8862 2991.6119 4002.8469 2991.6119 4002.8075 2991.5725 4002.8862 2991.5725 4002.8862 2991.6119 4002.8075 2991.5725 4002.8469 2991.5725 4002.9256 2991.6119 4002.8862 2991.6119 4002.8862 2991.5725 4002.9256 2991.6119 4002.8469 2991.5725 4002.8862 2991.5725 3990.7997 2996.2575 3990.7997 2996.2575"
            }
        }
    ]
}

Width from the screenshot is 4.55mm which is c_width * 10 in mil (179.134 / 39.37 = 4.55).
Height from the screenshot is 3.6mm which is c_height * 10 in mil (141.732 / 39.37 = 3.6).
The same applies for the Z offset: -15.748 / 39.37 = -0.4

Unfortuantely I have not yet found out where the X and Y offsets are coming from ...

@uPesy
Copy link
Owner

uPesy commented May 5, 2022

Thanks for your researchs !
For the X and Y offsets, it maybe comes from c_origin array ?
And applying the bbox values of the footprint

@github-actions
Copy link

github-actions bot commented Jun 5, 2022

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jun 5, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@uPesy uPesy reopened this Jun 13, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@Bouni
Copy link
Contributor Author

Bouni commented Jun 21, 2022

I think I found the solution (partially to be honest)

https://github.com/uPesy/easyeda2kicad.py/compare/dev...Bouni:3d-model-offsets?expand=1

With these changes, the 3d model for a couple of parts that previously had wrong offsets are working just fine:

C393942

image

C13453

image

C264374

image

Unfortunately I found one that is still offset and I cannot see why 😭

C545708

image

@uPesy uPesy reopened this Jun 21, 2022
@uPesy
Copy link
Owner

uPesy commented Jun 21, 2022

Thanks for your research !
For the last one it's maybe a rotation issue ? from 180° ?
You can send a PR to dev branch, and i will merge it :)

@Bouni
Copy link
Contributor Author

Bouni commented Jun 21, 2022

Done via PR #57 !

For the last one it's maybe a rotation issue ? from 180° ?
It has 270° as rotation but actually needs 90° and it needs 3.5mm z offset:

image

I simply don't get it why some parts work absolutely fine and others are just messed up 🤷🏽‍♂️

@Bouni
Copy link
Contributor Author

Bouni commented Jun 21, 2022

This is what easyeda shows for that part:

image

@github-actions github-actions bot removed the Stale label Jun 22, 2022
@uPesy
Copy link
Owner

uPesy commented Jun 27, 2022

I have fixed the issue for the rotation.
But for the x, y, z offset, it's very tricky :/

@uPesy
Copy link
Owner

uPesy commented Jun 27, 2022

Issue moved to global 3D model offset issue at #25, not on specific LCSC ID

@uPesy uPesy closed this as completed Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants