easyeda 0.0.190 → 0.0.191
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/browser/index.d.ts +74 -0
- package/dist/browser/index.js +32 -0
- package/dist/browser/index.js.map +1 -1
- package/dist/{chunk-7M472S57.js → chunk-QCARKWDE.js} +34 -2
- package/dist/{chunk-7M472S57.js.map → chunk-QCARKWDE.js.map} +1 -1
- package/dist/cli/main.js +2 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/lib/index.d.ts +904 -712
- package/dist/lib/index.js +1 -1
- package/package.json +1 -1
|
@@ -2222,6 +2222,17 @@ var handleHoleCutout = (hole, index) => {
|
|
|
2222
2222
|
radius: milx10(hole.radius)
|
|
2223
2223
|
});
|
|
2224
2224
|
};
|
|
2225
|
+
var handleVia = (via, index) => {
|
|
2226
|
+
return pcb_via.parse({
|
|
2227
|
+
type: "pcb_via",
|
|
2228
|
+
pcb_via_id: `pcb_via_${index + 1}`,
|
|
2229
|
+
x: milx10(via.center.x),
|
|
2230
|
+
y: milx10(via.center.y),
|
|
2231
|
+
outer_diameter: milx10(via.outerDiameter),
|
|
2232
|
+
hole_diameter: milx10(via.holeDiameter),
|
|
2233
|
+
layers: ["top", "bottom"]
|
|
2234
|
+
});
|
|
2235
|
+
};
|
|
2225
2236
|
var handleCutout = (solidRegion, index) => {
|
|
2226
2237
|
return pcb_cutout.parse({
|
|
2227
2238
|
type: "pcb_cutout",
|
|
@@ -2368,6 +2379,9 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, { useModelCdn, shouldRecente
|
|
|
2368
2379
|
soupElements.push(handleHole(h, index));
|
|
2369
2380
|
soupElements.push(handleHoleCutout(h, index));
|
|
2370
2381
|
});
|
|
2382
|
+
easyEdaJson.packageDetail.dataStr.shape.filter((shape) => shape.type === "VIA").forEach((v, index) => {
|
|
2383
|
+
soupElements.push(handleVia(v, index));
|
|
2384
|
+
});
|
|
2371
2385
|
easyEdaJson.packageDetail.dataStr.shape.filter(
|
|
2372
2386
|
(shape) => shape.type === "SOLIDREGION" && shape.fillStyle === "cutout"
|
|
2373
2387
|
).forEach((sr, index) => {
|
|
@@ -2583,6 +2597,12 @@ var HoleSchema = BaseShapeSchema.extend({
|
|
|
2583
2597
|
center: PointSchema,
|
|
2584
2598
|
radius: z84.number()
|
|
2585
2599
|
});
|
|
2600
|
+
var ViaSchema = BaseShapeSchema.extend({
|
|
2601
|
+
type: z84.literal("VIA"),
|
|
2602
|
+
center: PointSchema,
|
|
2603
|
+
outerDiameter: z84.number(),
|
|
2604
|
+
holeDiameter: z84.number()
|
|
2605
|
+
});
|
|
2586
2606
|
var RectSchema = BaseShapeSchema.extend({
|
|
2587
2607
|
type: z84.literal("RECT"),
|
|
2588
2608
|
x: tenthmil,
|
|
@@ -2612,6 +2632,7 @@ var PackageDetailShapeSchema = z84.discriminatedUnion("type", [
|
|
|
2612
2632
|
SolidRegionSchema,
|
|
2613
2633
|
SVGNodeSchema,
|
|
2614
2634
|
HoleSchema,
|
|
2635
|
+
ViaSchema,
|
|
2615
2636
|
RectSchema,
|
|
2616
2637
|
TextSchema
|
|
2617
2638
|
]);
|
|
@@ -2731,6 +2752,17 @@ var ShapeItemSchema = z84.object({
|
|
|
2731
2752
|
id
|
|
2732
2753
|
});
|
|
2733
2754
|
}
|
|
2755
|
+
case "VIA": {
|
|
2756
|
+
const [x, y, outerDiameter, , holeDiameter, id] = shape.data.split("~");
|
|
2757
|
+
const center = [Number(x), Number(y)];
|
|
2758
|
+
return ViaSchema.parse({
|
|
2759
|
+
type: "VIA",
|
|
2760
|
+
center,
|
|
2761
|
+
outerDiameter: Number(outerDiameter),
|
|
2762
|
+
holeDiameter: Number(holeDiameter),
|
|
2763
|
+
id
|
|
2764
|
+
});
|
|
2765
|
+
}
|
|
2734
2766
|
case "SOLIDREGION": {
|
|
2735
2767
|
const [layermask, , pathData, fillStyle, id] = shape.data.split("~");
|
|
2736
2768
|
const points = pathData.match(/[ML] ?(-?[\d.]+)[ ,](-?[\d.]+)/g)?.map((point2) => {
|
|
@@ -3448,9 +3480,9 @@ var convertEasyEdaJsonToVariousFormats = async ({
|
|
|
3448
3480
|
};
|
|
3449
3481
|
|
|
3450
3482
|
export {
|
|
3483
|
+
fetchEasyEDAComponent,
|
|
3451
3484
|
convertEasyEdaJsonToCircuitJson,
|
|
3452
3485
|
convertEasyEdaJsonToTscircuitSoupJson,
|
|
3453
|
-
fetchEasyEDAComponent,
|
|
3454
3486
|
maybeNumber,
|
|
3455
3487
|
SzlcscSchema,
|
|
3456
3488
|
LcscSchema,
|
|
@@ -3467,4 +3499,4 @@ export {
|
|
|
3467
3499
|
convertRawEasyToTsx,
|
|
3468
3500
|
convertEasyEdaJsonToVariousFormats
|
|
3469
3501
|
};
|
|
3470
|
-
//# sourceMappingURL=chunk-
|
|
3502
|
+
//# sourceMappingURL=chunk-QCARKWDE.js.map
|