@tscircuit/footprinter 0.0.217 → 0.0.219
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 +22 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -131,10 +131,9 @@ var u_curve = Array.from(
|
|
|
131
131
|
function convertMilToMm(value) {
|
|
132
132
|
if (typeof value === "string") {
|
|
133
133
|
if (value.trim().toLowerCase().endsWith("mil")) {
|
|
134
|
-
|
|
135
|
-
return num * 0.0254;
|
|
134
|
+
return parseFloat(value) * 0.0254;
|
|
136
135
|
}
|
|
137
|
-
return
|
|
136
|
+
return parseFloat(value);
|
|
138
137
|
}
|
|
139
138
|
return Number(value);
|
|
140
139
|
}
|
|
@@ -181,9 +180,9 @@ var getCcwDipCoords = (pinCount, pn, w, p) => {
|
|
|
181
180
|
const gs = p;
|
|
182
181
|
const h = gs * leftPinGaps;
|
|
183
182
|
if (isLeft) {
|
|
184
|
-
return { x: -w / 2
|
|
183
|
+
return { x: -w / 2, y: h / 2 - (pn - 1) * gs };
|
|
185
184
|
}
|
|
186
|
-
return { x: w / 2
|
|
185
|
+
return { x: w / 2, y: -h / 2 + (pn - ph - 1) * gs };
|
|
187
186
|
};
|
|
188
187
|
var dip = (raw_params) => {
|
|
189
188
|
const parameters = dip_def.parse(raw_params);
|
|
@@ -199,7 +198,9 @@ var dip = (raw_params) => {
|
|
|
199
198
|
platedhole(i + 1, x, y, parameters.id ?? "0.8mm", parameters.od ?? "1mm")
|
|
200
199
|
);
|
|
201
200
|
}
|
|
202
|
-
const
|
|
201
|
+
const padEdgeHeight = (parameters.num_pins / 2 - 1) * parameters.p + parameters.od;
|
|
202
|
+
const innerGap = parameters.w - parameters.od;
|
|
203
|
+
const sw = innerGap - 1;
|
|
203
204
|
const sh = (parameters.num_pins / 2 - 1) * parameters.p + parameters.od + 0.4;
|
|
204
205
|
const silkscreenBorder = {
|
|
205
206
|
layer: "top",
|
|
@@ -208,7 +209,7 @@ var dip = (raw_params) => {
|
|
|
208
209
|
route: [
|
|
209
210
|
{ x: -sw / 2, y: -sh / 2 },
|
|
210
211
|
{ x: -sw / 2, y: sh / 2 },
|
|
211
|
-
//
|
|
212
|
+
// U-notch curve outside the pads
|
|
212
213
|
...u_curve.map(({ x, y }) => ({
|
|
213
214
|
x: x * sw / 6,
|
|
214
215
|
y: y * sw / 6 + sh / 2
|
|
@@ -223,24 +224,26 @@ var dip = (raw_params) => {
|
|
|
223
224
|
const silkscreenPins = [];
|
|
224
225
|
for (let i = 0; i < parameters.num_pins; i++) {
|
|
225
226
|
const isLeft = i < parameters.num_pins / 2;
|
|
226
|
-
const
|
|
227
|
-
const
|
|
228
|
-
|
|
227
|
+
const clearance = 0.6;
|
|
228
|
+
const { y: pinCenterY } = getCcwDipCoords(
|
|
229
|
+
parameters.num_pins,
|
|
230
|
+
i + 1,
|
|
231
|
+
parameters.w,
|
|
232
|
+
parameters.p ?? 2.54
|
|
233
|
+
);
|
|
234
|
+
const pinLabelX = isLeft ? -parameters.w / 2 - parameters.od / 2 - clearance : parameters.w / 2 + parameters.od / 2 + clearance;
|
|
235
|
+
const pinLabelY = pinCenterY;
|
|
236
|
+
silkscreenPins.push({
|
|
229
237
|
type: "pcb_fabrication_note_text",
|
|
238
|
+
pcb_fabrication_note_text_id: `pin_${i + 1}`,
|
|
230
239
|
layer: "top",
|
|
231
240
|
pcb_component_id: `pin_${i + 1}`,
|
|
232
|
-
pcb_silkscreen_text_id: `pin_${i + 1}`,
|
|
233
241
|
text: `{pin${i + 1}}`,
|
|
234
|
-
anchor_position: {
|
|
235
|
-
x: pinLabelX,
|
|
236
|
-
y: pinLabelY
|
|
237
|
-
},
|
|
242
|
+
anchor_position: { x: pinLabelX, y: pinLabelY },
|
|
238
243
|
font_size: 0.3,
|
|
239
|
-
font_color: "red",
|
|
240
244
|
font: "tscircuit2024",
|
|
241
|
-
anchor_alignment: "
|
|
242
|
-
};
|
|
243
|
-
silkscreenPins.push(silkscreenPin2);
|
|
245
|
+
anchor_alignment: "top_left"
|
|
246
|
+
});
|
|
244
247
|
}
|
|
245
248
|
const silkscreenRefText = silkscreenRef(0, sh / 2 + 0.5, 0.4);
|
|
246
249
|
return {
|