174 lines
7.2 KiB
Markdown
174 lines
7.2 KiB
Markdown
# LCSC 3D Models
|
|
|
|
This is part of the easyeda2kicad code.
|
|
The whole code depends on pydantic and typing_extensions.
|
|
The dependencies didn't even install using pip on Debian 11.6.
|
|
|
|
This is the portion of the code needed to download the 3D model for an LCSC component code.
|
|
The generated WRL has colors, but not correct materials.
|
|
|
|
This is all related to the issue #380
|
|
|
|
# Colors
|
|
|
|
diffuse - specular
|
|
|
|
## Analyzed
|
|
|
|
### SOT-23-3P_L2.9-W1.3-H1.0-LS2.4-P0.95.wrl (C181094)
|
|
- LCEDA: 1.0 1.0 1.0 - 0.8784313725490196 0.8784313725490196 0.8784313725490196
|
|
- Silver pins:0.7686274509803922 0.7686274509803922 0.7686274509803922 - 0.615686274509804 0.615686274509804 0.615686274509804
|
|
- Plastic body: 0.25098039215686274 0.25098039215686274 0.25098039215686274 - 0.07450980392156863 0.07450980392156863 0.07450980392156863
|
|
- Text legend: 0.45098039215686275 0.43137254901960786 0.4196078431372549 - 0.03137254901960784 0.03137254901960784 0.03137254901960784
|
|
|
|
### CONN-TH_4P-P2.54_MOLEX_0705430004.wrl (C3020650)
|
|
|
|
This model is wrong, the pins should be gold
|
|
|
|
- Silver pins:(also legend) 0.8313725490196079 0.8313725490196079 0.8196078431372549 - 0.6666666666666666 0.6666666666666666 0.6549019607843137
|
|
- Plastic body: 0.20784313725490197 0.20784313725490197 0.20784313725490197 - 0.01568627450980392 0.01568627450980392 0.01568627450980392
|
|
- Plastic body pin 1 arrow: 0.07058823529411765 0.07058823529411765 0.07058823529411765 - 0.00392156862745098 0.00392156862745098 0.00392156862745098
|
|
- Error color used to fill the legend ... should be plastic body, an error: 0.792156862745098 0.8196078431372549 0.9333333333333333 - 0.396078431372549 0.4117647058823529 0.4666666666666667
|
|
|
|
### HDR2.54-M-LI-1X1P.wrl (C213440)
|
|
|
|
- Golden pins: 0.9490196078431372 0.7607843137254902 0.1803921568627451 - 0.7607843137254902 0.6078431372549019 0.1450980392156863
|
|
- Plastic body: 0.17647058823529413 0.17647058823529413 0.17647058823529413 - 0.050980392156862744 0.050980392156862744 0.050980392156862744
|
|
- LCEDA: 0.0 0.0 0.0 - 0.0 0.0 0.0
|
|
|
|
### SMB_L4.6-W3.6-LS5.3-BI.wrl (C78395)
|
|
|
|
- Plastic body: 0.25098039215686274 0.25098039215686274 0.25098039215686274 - 0.12549019607843137 0.12549019607843137 0.12549019607843137
|
|
- Silver pins: 0.7803921568627451 0.7803921568627451 0.7803921568627451 - 0.38823529411764707 0.38823529411764707 0.38823529411764707
|
|
- LCEDA: 1.0 1.0 1.0 - 0.8784313725490196 0.8784313725490196 0.8784313725490196
|
|
|
|
### SMA_L4.3-W2.6-LS5.2-RD (C8678)
|
|
|
|
- Plastic body: 0.25098039215686274 0.25098039215686274 0.25098039215686274 - 0.12549019607843137 0.12549019607843137 0.12549019607843137
|
|
- Silver pins: 0.7803921568627451 0.7803921568627451 0.7803921568627451 - 0.38823529411764707 0.38823529411764707 0.38823529411764707
|
|
- Text legend: 0.6666666666666666 0.6666666666666666 0.6666666666666666 - 0.3333333333333333 0.3333333333333333 0.3333333333333333
|
|
- LCEDA 1.0 1.0 1.0 - 0.8784313725490196 0.8784313725490196 0.8784313725490196
|
|
- Pin 1 bars 0.8509803921568627 0.8509803921568627 0.8509803921568627 - 0.4235294117647059 0.4235294117647059 0.4235294117647059
|
|
|
|
### SOT-23-6_L2.9-W1.6-H1.5-LS2.8-P0.95.wrl (C202311)
|
|
|
|
- Plastic body: 0.25098039215686274 0.25098039215686274 0.25098039215686274 - 0.07450980392156863 0.07450980392156863 0.07450980392156863
|
|
- Text legend: 0.45098039215686275 0.43137254901960786 0.4196078431372549 - 0.03137254901960784 0.03137254901960784 0.03137254901960784
|
|
- LCEDA 1.0 1.0 1.0 - 0.8784313725490196 0.8784313725490196 0.8784313725490196
|
|
- Silver pins: 0.7686274509803922 0.7686274509803922 0.7686274509803922 - 0.615686274509804 0.615686274509804 0.615686274509804
|
|
|
|
### SOIC-8_L4.9-W3.9-P1.27-LS6.0-BL-EP3.3-1.wrl (C2760005)
|
|
|
|
- Plastic body: 0.20784313725490197 0.20784313725490197 0.20784313725490197 - 0.01568627450980392 0.01568627450980392 0.01568627450980392
|
|
- Pin 1 circle: 0.34901960784313724 0.34901960784313724 0.34901960784313724 - 0.023529411764705882 0.023529411764705882 0.023529411764705882
|
|
- Silver pins: 0.6666666666666666 0.6666666666666666 0.6666666666666666 - 0.4666666666666667 0.4666666666666667 0.4666666666666667
|
|
- LCEDA: 1.0 1.0 1.0 - 0.5019607843137255 0.5019607843137255 0.5019607843137255
|
|
|
|
### SW-SMD_4P-L5.2-W5.2-H1.5-LS6.4-P3.70 (C318884)
|
|
|
|
- Metal body 0.8313725490196079 0.8392156862745098 0.8313725490196079 - 0.4980392156862745 0.5019607843137255 0.4980392156862745
|
|
- Plastic inner body 0.07058823529411765 0.07058823529411765 0.07058823529411765 - 0.00392156862745098 0.00392156862745098 0.00392156862745098
|
|
- Golden button 0.9490196078431372 0.7607843137254902 0.1803921568627451 - 0.7607843137254902 0.6078431372549019 0.1450980392156863
|
|
- Plastic body 0.2980392156862745 0.2980392156862745 0.2980392156862745 - 0.09019607843137255 0.09019607843137255 0.09019607843137255
|
|
- Silver pins: 0.7686274509803922 0.7686274509803922 0.7686274509803922 - 0.615686274509804 0.615686274509804 0.615686274509804
|
|
- LCEDA 1.0 1.0 1.0 - 0.8784313725490196 0.8784313725490196 0.8784313725490196
|
|
|
|
### SW-TH_SPEF110100 C115366
|
|
|
|
This model uses d = 1, but isn't transparent
|
|
|
|
- Metal body and Silver pins 0.9686274509803922 0.9686274509803922 0.9686274509803922 - 0.7529411764705882 0.7529411764705882 0.7529411764705882
|
|
- Plastic body 0.25882352941176473 0.25882352941176473 0.25882352941176473 - 0.7529411764705882 0.7529411764705882 0.7529411764705882
|
|
|
|
## Groups
|
|
|
|
### Silver Metal
|
|
|
|
- 0.969 0.969 0.969 - 0.753 0.753 0.753
|
|
- 0.831 0.831 0.820 - 0.667 0.667 0.655 (1,56% de error en B)
|
|
- 0.780 0.780 0.780 - 0.388 0.388 0.388 (2x)
|
|
- 0.769 0.769 0.769 - 0.616 0.616 0.616 (3x)
|
|
- 0.667 0.667 0.667 - 0.467 0.467 0.467
|
|
|
|
### Plastic body
|
|
|
|
- 0.298 0.298 0.298 - 0.090 0.090 0.090
|
|
- 0.259 0.259 0.259 - 0.753 0.753 0.753
|
|
- 0.251 0.251 0.251 - 0.125 0.125 0.125 (2x)
|
|
- 0.251 0.251 0.251 - 0.075 0.075 0.075 (2x)
|
|
- 0.208 0.208 0.208 - 0.016 0.016 0.016 (2x)
|
|
- 0.176 0.176 0.176 - 0.051 0.051 0.051
|
|
|
|
### Golden Metal
|
|
|
|
- 0.949 0.761 0.180 - 0.761 0.608 0.145 (2x)
|
|
|
|
|
|
# Position
|
|
|
|
## C181094
|
|
|
|
This is an analysis of the positions indicated by EasyEDA and KiCad.
|
|
Is related to #380, the conclusion was that the 3D model adjust wasn't needed for the footprint once exported to KiCad.
|
|
|
|
Data from the EasyEDA API:
|
|
|
|
```
|
|
translation=Ee3dModelBase(x='608', y='-320', z='0'),
|
|
rotation=Ee3dModelBase(x='0', y='0', z='180'),
|
|
```
|
|
|
|
PAD 1 position according to EasyEDA footprint
|
|
|
|
```
|
|
PAD
|
|
- RECT
|
|
- 4003.937
|
|
- 3003.74
|
|
- 4.9213
|
|
- 2.7559
|
|
- 1
|
|
-
|
|
- 1
|
|
- 0
|
|
- 4001.4764
|
|
```
|
|
|
|
KiCad 3D model offset
|
|
|
|
```
|
|
(offset (xyz -861.57 843.28 -0))
|
|
(scale (xyz 1 1 1))
|
|
(rotate (xyz 0 0 180))
|
|
```
|
|
|
|
KiCad PAD 1
|
|
|
|
```
|
|
(pad "1" smd rect locked (at 1 0.95) (size 1.25 0.7) (layers "F.Cu" "F.Paste" "F.Mask")
|
|
(net 2 "GND") (pinfunction "G") (pintype "input") (tstamp 12c57c2f-095b-44d0-b46b-b41b1ec9add0))
|
|
```
|
|
|
|
Some math:
|
|
|
|
```
|
|
4003.937 - 608 = 3395.937*0.254 = 862.57 (1 mm off == x position for KiCad pad 1)
|
|
3003.74 - (-320) = 3323.74*0.254 = 844.23 (0.95 mm off == y position for KiCad pad 1)
|
|
|
|
1 mil = 25.4/1000 = 0.0254
|
|
|
|
861.57/0.254 = 3392+608 = 4000 (rounded!)
|
|
843.28/0.254 = 3320-320 = 3000 (rounded!)
|
|
|
|
(EE_PAD.x - EE_3D_offset.x) * 25.4/100 - KI_PAD.x = (4003.937-608)*0.254-1 = 861.567998
|
|
(EE_PAD.y - EE_3D_offset.y) * 25.4/100 - KI_PAD.y = (3003.74-(-320))*0.254-0.95 = 843.27996
|
|
|
|
Rotated 180 degrees is x' = -x; y' = y
|
|
x=-861.57
|
|
y=843.28
|
|
z=0
|
|
```
|
|
|
|
The VRML is scaled x/2.54, coordinates are from the PCB, but Y axis is negative.
|
|
|