jscad-electronics 0.0.126 → 0.0.128
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/dist/index.js +130 -49
- package/dist/index.js.map +1 -1
- package/dist/vanilla.js +79 -5
- package/dist/vanilla.js.map +1 -1
- package/package.json +4 -3
package/dist/vanilla.js
CHANGED
|
@@ -72,13 +72,75 @@ var FootprintPlatedHole = ({
|
|
|
72
72
|
/* @__PURE__ */ jsx(
|
|
73
73
|
Cuboid,
|
|
74
74
|
{
|
|
75
|
-
size: [hole.rect_pad_width, hole.
|
|
75
|
+
size: [hole.rect_pad_width, hole.rect_pad_height, 0.01],
|
|
76
76
|
center: [0, 0, 0]
|
|
77
77
|
}
|
|
78
78
|
),
|
|
79
79
|
/* @__PURE__ */ jsx(Cylinder, { radius: hole.hole_diameter / 2, height: 0.01 })
|
|
80
80
|
] }) }) });
|
|
81
81
|
}
|
|
82
|
+
if (hole.shape === "pill") {
|
|
83
|
+
const width10 = hole.outer_width;
|
|
84
|
+
const height10 = hole.outer_height;
|
|
85
|
+
const radius = Math.min(width10, height10) / 2;
|
|
86
|
+
const isHorizontal = width10 > height10;
|
|
87
|
+
const holeWidth = hole.hole_width ?? 0.8;
|
|
88
|
+
const holeHeight = hole.hole_height ?? 0.8;
|
|
89
|
+
return /* @__PURE__ */ jsx(Colorize, { color, children: /* @__PURE__ */ jsx(Translate, { offset: [hole.x, hole.y, 0], children: /* @__PURE__ */ jsxs(Subtract, { children: [
|
|
90
|
+
/* @__PURE__ */ jsxs(Hull, { children: [
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
Cylinder,
|
|
93
|
+
{
|
|
94
|
+
radius,
|
|
95
|
+
height: 0.01,
|
|
96
|
+
center: [
|
|
97
|
+
isHorizontal ? -(width10 / 2 - radius) : 0,
|
|
98
|
+
isHorizontal ? 0 : -(height10 / 2 - radius),
|
|
99
|
+
0
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ jsx(
|
|
104
|
+
Cylinder,
|
|
105
|
+
{
|
|
106
|
+
radius,
|
|
107
|
+
height: 0.01,
|
|
108
|
+
center: [
|
|
109
|
+
isHorizontal ? width10 / 2 - radius : 0,
|
|
110
|
+
isHorizontal ? 0 : height10 / 2 - radius,
|
|
111
|
+
0
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] }),
|
|
116
|
+
holeWidth === holeHeight ? /* @__PURE__ */ jsx(Cylinder, { radius: holeWidth / 2, height: 0.01 }) : /* @__PURE__ */ jsxs(Hull, { children: [
|
|
117
|
+
/* @__PURE__ */ jsx(
|
|
118
|
+
Cylinder,
|
|
119
|
+
{
|
|
120
|
+
radius: Math.min(holeWidth, holeHeight) / 2,
|
|
121
|
+
height: 0.01,
|
|
122
|
+
center: [
|
|
123
|
+
holeWidth > holeHeight ? -(holeWidth / 2 - holeHeight / 2) : 0,
|
|
124
|
+
holeWidth > holeHeight ? 0 : -(holeHeight / 2 - holeWidth / 2),
|
|
125
|
+
0
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
Cylinder,
|
|
131
|
+
{
|
|
132
|
+
radius: Math.min(holeWidth, holeHeight) / 2,
|
|
133
|
+
height: 0.01,
|
|
134
|
+
center: [
|
|
135
|
+
holeWidth > holeHeight ? holeWidth / 2 - holeHeight / 2 : 0,
|
|
136
|
+
holeWidth > holeHeight ? 0 : holeHeight / 2 - holeWidth / 2,
|
|
137
|
+
0
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] })
|
|
142
|
+
] }) }) });
|
|
143
|
+
}
|
|
82
144
|
throw new Error("Shape not supported: " + hole.shape);
|
|
83
145
|
};
|
|
84
146
|
|
|
@@ -4631,21 +4693,33 @@ var JSTZH1_5mm = ({
|
|
|
4631
4693
|
}
|
|
4632
4694
|
) }, i)),
|
|
4633
4695
|
showFootprint && Array.from({ length: numPins }).map((_, i) => {
|
|
4634
|
-
const
|
|
4696
|
+
const isPin1 = i === 0;
|
|
4697
|
+
const hole = isPin1 ? {
|
|
4635
4698
|
type: "pcb_plated_hole",
|
|
4636
4699
|
pcb_plated_hole_id: `jstzh_${i}`,
|
|
4637
4700
|
shape: "circular_hole_with_rect_pad",
|
|
4638
4701
|
x: startX + i * pitch,
|
|
4639
4702
|
y: 0,
|
|
4640
4703
|
hole_diameter: 0.73,
|
|
4641
|
-
hole_shape: "circle",
|
|
4642
|
-
pad_shape: "rect",
|
|
4643
4704
|
rect_pad_width: 1.03,
|
|
4644
4705
|
rect_pad_height: 1.73,
|
|
4706
|
+
hole_shape: "circle",
|
|
4707
|
+
pad_shape: "rect",
|
|
4708
|
+
layers: ["top", "bottom"],
|
|
4709
|
+
port_hints: [`${i + 1}`]
|
|
4710
|
+
} : {
|
|
4711
|
+
type: "pcb_plated_hole",
|
|
4712
|
+
pcb_plated_hole_id: `jstzh_${i}`,
|
|
4713
|
+
shape: "pill",
|
|
4714
|
+
x: startX + i * pitch,
|
|
4715
|
+
y: 0,
|
|
4716
|
+
hole_height: 0.73,
|
|
4717
|
+
hole_width: 0.73,
|
|
4718
|
+
outer_height: 1.73,
|
|
4719
|
+
outer_width: 1.03,
|
|
4645
4720
|
layers: ["top", "bottom"],
|
|
4646
4721
|
port_hints: [`${i + 1}`]
|
|
4647
4722
|
};
|
|
4648
|
-
const isPin1 = i === 0;
|
|
4649
4723
|
return /* @__PURE__ */ jsx(
|
|
4650
4724
|
FootprintPlatedHole,
|
|
4651
4725
|
{
|