jscad-electronics 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +47 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
jscad-electronics is a library of 3D electronic component models for use with [JSCAD](https://github.com/jscad/OpenJSCAD.org) and [tscircuit](https://github.com/tscircuit/tscircuit). It provides accurate and customizable 3D models for various electronic components, making it easier to create 3D representations of PCBs and electronic assemblies.
|
|
11
11
|
|
|
12
|
+
Contribution Guide:
|
|
13
|
+
|
|
14
|
+
[](https://youtu.be/DHGW_DFhJao)
|
|
15
|
+
|
|
16
|
+
|
|
12
17
|
## Features
|
|
13
18
|
|
|
14
19
|
- Wide range of electronic component models (e.g., resistors, capacitors, ICs, connectors)
|
package/dist/index.d.ts
CHANGED
|
@@ -86,9 +86,12 @@ interface SmdChipLeadProps {
|
|
|
86
86
|
*/
|
|
87
87
|
declare const SmdChipLead: (props: SmdChipLeadProps) => react_jsx_runtime.JSX.Element;
|
|
88
88
|
|
|
89
|
-
declare const Tssop: ({ pinCount,
|
|
89
|
+
declare const Tssop: ({ pinCount, pl, pw, p, bodyWidth, }: {
|
|
90
90
|
pinCount: number;
|
|
91
|
-
|
|
91
|
+
p: number;
|
|
92
|
+
pw: number;
|
|
93
|
+
pl: number;
|
|
94
|
+
bodyWidth: number;
|
|
92
95
|
}) => react_jsx_runtime.JSX.Element;
|
|
93
96
|
|
|
94
97
|
declare const QFN: ({ fullWidth, height, thermalPadSize, }: {
|
package/dist/index.js
CHANGED
|
@@ -78487,7 +78487,7 @@ var ExtrudedPads = ({
|
|
|
78487
78487
|
};
|
|
78488
78488
|
|
|
78489
78489
|
// lib/Footprinter3d.tsx
|
|
78490
|
-
import { fp as
|
|
78490
|
+
import { fp as fp4 } from "@tscircuit/footprinter";
|
|
78491
78491
|
|
|
78492
78492
|
// lib/DualInlinePackage.tsx
|
|
78493
78493
|
var import_jscad_fiber8 = __toESM(require_dist(), 1);
|
|
@@ -78643,6 +78643,9 @@ var Dip = ({
|
|
|
78643
78643
|
] });
|
|
78644
78644
|
};
|
|
78645
78645
|
|
|
78646
|
+
// lib/Tssop.tsx
|
|
78647
|
+
import "@tscircuit/footprinter";
|
|
78648
|
+
|
|
78646
78649
|
// lib/SmdChipLead.tsx
|
|
78647
78650
|
var import_jscad_fiber9 = __toESM(require_dist(), 1);
|
|
78648
78651
|
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -78678,24 +78681,27 @@ var SmdChipLead = (props) => {
|
|
|
78678
78681
|
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
|
|
78679
78682
|
var Tssop = ({
|
|
78680
78683
|
pinCount,
|
|
78681
|
-
|
|
78684
|
+
pl,
|
|
78685
|
+
pw,
|
|
78686
|
+
p,
|
|
78687
|
+
bodyWidth
|
|
78682
78688
|
}) => {
|
|
78683
78689
|
const sidePinLength = Math.ceil(pinCount / 2);
|
|
78684
|
-
const fullLength4 =
|
|
78685
|
-
const pinOffsetToCenter = (sidePinLength - 1) *
|
|
78690
|
+
const fullLength4 = p * pinCount / 2 + pw / 2;
|
|
78691
|
+
const pinOffsetToCenter = (sidePinLength - 1) * p / 2;
|
|
78686
78692
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
78687
78693
|
Array.from({ length: sidePinLength }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
78688
78694
|
SmdChipLead,
|
|
78689
78695
|
{
|
|
78690
78696
|
position: {
|
|
78691
|
-
x: -
|
|
78692
|
-
y: i *
|
|
78697
|
+
x: -bodyWidth / 2 - 0.9,
|
|
78698
|
+
y: i * p - pinOffsetToCenter,
|
|
78693
78699
|
z: 0
|
|
78694
78700
|
},
|
|
78695
|
-
width:
|
|
78696
|
-
thickness: 0.
|
|
78697
|
-
padContactLength:
|
|
78698
|
-
bodyDistance:
|
|
78701
|
+
width: pw,
|
|
78702
|
+
thickness: 0.25,
|
|
78703
|
+
padContactLength: pl,
|
|
78704
|
+
bodyDistance: pl + 0.4,
|
|
78699
78705
|
height: 0.8
|
|
78700
78706
|
},
|
|
78701
78707
|
i
|
|
@@ -78704,11 +78710,15 @@ var Tssop = ({
|
|
|
78704
78710
|
SmdChipLead,
|
|
78705
78711
|
{
|
|
78706
78712
|
rotation: Math.PI,
|
|
78707
|
-
position: {
|
|
78708
|
-
|
|
78709
|
-
|
|
78710
|
-
|
|
78711
|
-
|
|
78713
|
+
position: {
|
|
78714
|
+
x: bodyWidth / 2 + 0.9,
|
|
78715
|
+
y: i * p - pinOffsetToCenter,
|
|
78716
|
+
z: 0
|
|
78717
|
+
},
|
|
78718
|
+
width: pw,
|
|
78719
|
+
thickness: 0.25,
|
|
78720
|
+
padContactLength: pl,
|
|
78721
|
+
bodyDistance: pl + 0.4,
|
|
78712
78722
|
height: 0.8
|
|
78713
78723
|
},
|
|
78714
78724
|
i
|
|
@@ -78717,7 +78727,7 @@ var Tssop = ({
|
|
|
78717
78727
|
ChipBody,
|
|
78718
78728
|
{
|
|
78719
78729
|
center: { x: 0, y: 0, z: 0 },
|
|
78720
|
-
width:
|
|
78730
|
+
width: bodyWidth,
|
|
78721
78731
|
length: fullLength4,
|
|
78722
78732
|
height: 1.5
|
|
78723
78733
|
}
|
|
@@ -78728,14 +78738,32 @@ var Tssop = ({
|
|
|
78728
78738
|
// lib/Footprinter3d.tsx
|
|
78729
78739
|
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
|
|
78730
78740
|
var Footprinter3d = ({ footprint }) => {
|
|
78731
|
-
const fpJson =
|
|
78741
|
+
const fpJson = fp4.string(footprint).json();
|
|
78732
78742
|
switch (fpJson.fn) {
|
|
78733
78743
|
case "dip":
|
|
78734
78744
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Dip, { numPins: fpJson.num_pins });
|
|
78735
78745
|
case "tssop":
|
|
78736
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
78746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
78747
|
+
Tssop,
|
|
78748
|
+
{
|
|
78749
|
+
pinCount: fpJson.num_pins,
|
|
78750
|
+
pl: fpJson.pl,
|
|
78751
|
+
pw: fpJson.pw,
|
|
78752
|
+
p: fpJson.p,
|
|
78753
|
+
bodyWidth: fpJson.w
|
|
78754
|
+
}
|
|
78755
|
+
);
|
|
78737
78756
|
case "soic":
|
|
78738
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
78757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
78758
|
+
Tssop,
|
|
78759
|
+
{
|
|
78760
|
+
pinCount: fpJson.num_pins,
|
|
78761
|
+
pl: fpJson.pl,
|
|
78762
|
+
pw: fpJson.pw,
|
|
78763
|
+
p: fpJson.p,
|
|
78764
|
+
bodyWidth: fpJson.w
|
|
78765
|
+
}
|
|
78766
|
+
);
|
|
78739
78767
|
}
|
|
78740
78768
|
switch (fpJson.imperial) {
|
|
78741
78769
|
case "0402":
|