easyeda 0.0.327 → 0.0.329
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 +29 -11
- package/dist/browser/index.js +116 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/index.d.ts +29 -11
- package/dist/index.js +116 -2
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +117 -3
- package/dist/main.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -234,9 +234,9 @@ declare const DataStrSchema: z.ZodEffects<z.ZodObject<{
|
|
|
234
234
|
y: number;
|
|
235
235
|
};
|
|
236
236
|
radius: number;
|
|
237
|
+
pathData: string;
|
|
237
238
|
lineWidth: number;
|
|
238
239
|
sweepFlag: boolean;
|
|
239
|
-
pathData: string;
|
|
240
240
|
color: string;
|
|
241
241
|
} | {
|
|
242
242
|
path: string;
|
|
@@ -606,9 +606,9 @@ declare const DataStrSchema: z.ZodEffects<z.ZodObject<{
|
|
|
606
606
|
y: number;
|
|
607
607
|
};
|
|
608
608
|
radius: number;
|
|
609
|
+
pathData: string;
|
|
609
610
|
lineWidth: number;
|
|
610
611
|
sweepFlag: boolean;
|
|
611
|
-
pathData: string;
|
|
612
612
|
color: string;
|
|
613
613
|
}, {
|
|
614
614
|
type: "ARC";
|
|
@@ -622,9 +622,9 @@ declare const DataStrSchema: z.ZodEffects<z.ZodObject<{
|
|
|
622
622
|
y: number;
|
|
623
623
|
};
|
|
624
624
|
radius: number;
|
|
625
|
+
pathData: string;
|
|
625
626
|
lineWidth: number;
|
|
626
627
|
sweepFlag: boolean;
|
|
627
|
-
pathData: string;
|
|
628
628
|
color: string;
|
|
629
629
|
}>]>>, "many">;
|
|
630
630
|
BBox: z.ZodOptional<z.ZodObject<{
|
|
@@ -681,9 +681,9 @@ declare const DataStrSchema: z.ZodEffects<z.ZodObject<{
|
|
|
681
681
|
y: number;
|
|
682
682
|
};
|
|
683
683
|
radius: number;
|
|
684
|
+
pathData: string;
|
|
684
685
|
lineWidth: number;
|
|
685
686
|
sweepFlag: boolean;
|
|
686
|
-
pathData: string;
|
|
687
687
|
color: string;
|
|
688
688
|
} | {
|
|
689
689
|
path: string;
|
|
@@ -831,9 +831,9 @@ declare const DataStrSchema: z.ZodEffects<z.ZodObject<{
|
|
|
831
831
|
y: number;
|
|
832
832
|
};
|
|
833
833
|
radius: number;
|
|
834
|
+
pathData: string;
|
|
834
835
|
lineWidth: number;
|
|
835
836
|
sweepFlag: boolean;
|
|
836
|
-
pathData: string;
|
|
837
837
|
color: string;
|
|
838
838
|
} | {
|
|
839
839
|
path: string;
|
|
@@ -1036,6 +1036,7 @@ declare const PackageDetailDataStrSchema: z.ZodObject<{
|
|
|
1036
1036
|
y: number;
|
|
1037
1037
|
}[];
|
|
1038
1038
|
layermask: number;
|
|
1039
|
+
pathData: string;
|
|
1039
1040
|
fillStyle: string;
|
|
1040
1041
|
id?: string | undefined;
|
|
1041
1042
|
layer?: number | undefined;
|
|
@@ -1294,6 +1295,7 @@ declare const PackageDetailDataStrSchema: z.ZodObject<{
|
|
|
1294
1295
|
} & {
|
|
1295
1296
|
type: z.ZodLiteral<"SOLIDREGION">;
|
|
1296
1297
|
layermask: z.ZodNumber;
|
|
1298
|
+
pathData: z.ZodString;
|
|
1297
1299
|
points: z.ZodArray<z.ZodPipeline<z.ZodEffects<z.ZodAny, any, any>, z.ZodObject<{
|
|
1298
1300
|
x: z.ZodNumber;
|
|
1299
1301
|
y: z.ZodNumber;
|
|
@@ -1312,6 +1314,7 @@ declare const PackageDetailDataStrSchema: z.ZodObject<{
|
|
|
1312
1314
|
y: number;
|
|
1313
1315
|
}[];
|
|
1314
1316
|
layermask: number;
|
|
1317
|
+
pathData: string;
|
|
1315
1318
|
fillStyle: string;
|
|
1316
1319
|
id?: string | undefined;
|
|
1317
1320
|
layer?: number | undefined;
|
|
@@ -1319,6 +1322,7 @@ declare const PackageDetailDataStrSchema: z.ZodObject<{
|
|
|
1319
1322
|
type: "SOLIDREGION";
|
|
1320
1323
|
points: any[];
|
|
1321
1324
|
layermask: number;
|
|
1325
|
+
pathData: string;
|
|
1322
1326
|
id?: string | undefined;
|
|
1323
1327
|
layer?: number | undefined;
|
|
1324
1328
|
fillStyle?: string | undefined;
|
|
@@ -1602,6 +1606,7 @@ declare const PackageDetailDataStrSchema: z.ZodObject<{
|
|
|
1602
1606
|
y: number;
|
|
1603
1607
|
}[];
|
|
1604
1608
|
layermask: number;
|
|
1609
|
+
pathData: string;
|
|
1605
1610
|
fillStyle: string;
|
|
1606
1611
|
id?: string | undefined;
|
|
1607
1612
|
layer?: number | undefined;
|
|
@@ -1845,6 +1850,7 @@ declare const PackageDetailSchema: z.ZodObject<{
|
|
|
1845
1850
|
y: number;
|
|
1846
1851
|
}[];
|
|
1847
1852
|
layermask: number;
|
|
1853
|
+
pathData: string;
|
|
1848
1854
|
fillStyle: string;
|
|
1849
1855
|
id?: string | undefined;
|
|
1850
1856
|
layer?: number | undefined;
|
|
@@ -2103,6 +2109,7 @@ declare const PackageDetailSchema: z.ZodObject<{
|
|
|
2103
2109
|
} & {
|
|
2104
2110
|
type: z.ZodLiteral<"SOLIDREGION">;
|
|
2105
2111
|
layermask: z.ZodNumber;
|
|
2112
|
+
pathData: z.ZodString;
|
|
2106
2113
|
points: z.ZodArray<z.ZodPipeline<z.ZodEffects<z.ZodAny, any, any>, z.ZodObject<{
|
|
2107
2114
|
x: z.ZodNumber;
|
|
2108
2115
|
y: z.ZodNumber;
|
|
@@ -2121,6 +2128,7 @@ declare const PackageDetailSchema: z.ZodObject<{
|
|
|
2121
2128
|
y: number;
|
|
2122
2129
|
}[];
|
|
2123
2130
|
layermask: number;
|
|
2131
|
+
pathData: string;
|
|
2124
2132
|
fillStyle: string;
|
|
2125
2133
|
id?: string | undefined;
|
|
2126
2134
|
layer?: number | undefined;
|
|
@@ -2128,6 +2136,7 @@ declare const PackageDetailSchema: z.ZodObject<{
|
|
|
2128
2136
|
type: "SOLIDREGION";
|
|
2129
2137
|
points: any[];
|
|
2130
2138
|
layermask: number;
|
|
2139
|
+
pathData: string;
|
|
2131
2140
|
id?: string | undefined;
|
|
2132
2141
|
layer?: number | undefined;
|
|
2133
2142
|
fillStyle?: string | undefined;
|
|
@@ -2411,6 +2420,7 @@ declare const PackageDetailSchema: z.ZodObject<{
|
|
|
2411
2420
|
y: number;
|
|
2412
2421
|
}[];
|
|
2413
2422
|
layermask: number;
|
|
2423
|
+
pathData: string;
|
|
2414
2424
|
fillStyle: string;
|
|
2415
2425
|
id?: string | undefined;
|
|
2416
2426
|
layer?: number | undefined;
|
|
@@ -2606,6 +2616,7 @@ declare const PackageDetailSchema: z.ZodObject<{
|
|
|
2606
2616
|
y: number;
|
|
2607
2617
|
}[];
|
|
2608
2618
|
layermask: number;
|
|
2619
|
+
pathData: string;
|
|
2609
2620
|
fillStyle: string;
|
|
2610
2621
|
id?: string | undefined;
|
|
2611
2622
|
layer?: number | undefined;
|
|
@@ -2942,9 +2953,9 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
2942
2953
|
y: number;
|
|
2943
2954
|
};
|
|
2944
2955
|
radius: number;
|
|
2956
|
+
pathData: string;
|
|
2945
2957
|
lineWidth: number;
|
|
2946
2958
|
sweepFlag: boolean;
|
|
2947
|
-
pathData: string;
|
|
2948
2959
|
color: string;
|
|
2949
2960
|
} | {
|
|
2950
2961
|
path: string;
|
|
@@ -3314,9 +3325,9 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
3314
3325
|
y: number;
|
|
3315
3326
|
};
|
|
3316
3327
|
radius: number;
|
|
3328
|
+
pathData: string;
|
|
3317
3329
|
lineWidth: number;
|
|
3318
3330
|
sweepFlag: boolean;
|
|
3319
|
-
pathData: string;
|
|
3320
3331
|
color: string;
|
|
3321
3332
|
}, {
|
|
3322
3333
|
type: "ARC";
|
|
@@ -3330,9 +3341,9 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
3330
3341
|
y: number;
|
|
3331
3342
|
};
|
|
3332
3343
|
radius: number;
|
|
3344
|
+
pathData: string;
|
|
3333
3345
|
lineWidth: number;
|
|
3334
3346
|
sweepFlag: boolean;
|
|
3335
|
-
pathData: string;
|
|
3336
3347
|
color: string;
|
|
3337
3348
|
}>]>>, "many">;
|
|
3338
3349
|
BBox: z.ZodOptional<z.ZodObject<{
|
|
@@ -3389,9 +3400,9 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
3389
3400
|
y: number;
|
|
3390
3401
|
};
|
|
3391
3402
|
radius: number;
|
|
3403
|
+
pathData: string;
|
|
3392
3404
|
lineWidth: number;
|
|
3393
3405
|
sweepFlag: boolean;
|
|
3394
|
-
pathData: string;
|
|
3395
3406
|
color: string;
|
|
3396
3407
|
} | {
|
|
3397
3408
|
path: string;
|
|
@@ -3539,9 +3550,9 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
3539
3550
|
y: number;
|
|
3540
3551
|
};
|
|
3541
3552
|
radius: number;
|
|
3553
|
+
pathData: string;
|
|
3542
3554
|
lineWidth: number;
|
|
3543
3555
|
sweepFlag: boolean;
|
|
3544
|
-
pathData: string;
|
|
3545
3556
|
color: string;
|
|
3546
3557
|
} | {
|
|
3547
3558
|
path: string;
|
|
@@ -3773,6 +3784,7 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
3773
3784
|
y: number;
|
|
3774
3785
|
}[];
|
|
3775
3786
|
layermask: number;
|
|
3787
|
+
pathData: string;
|
|
3776
3788
|
fillStyle: string;
|
|
3777
3789
|
id?: string | undefined;
|
|
3778
3790
|
layer?: number | undefined;
|
|
@@ -4031,6 +4043,7 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
4031
4043
|
} & {
|
|
4032
4044
|
type: z.ZodLiteral<"SOLIDREGION">;
|
|
4033
4045
|
layermask: z.ZodNumber;
|
|
4046
|
+
pathData: z.ZodString;
|
|
4034
4047
|
points: z.ZodArray<z.ZodPipeline<z.ZodEffects<z.ZodAny, any, any>, z.ZodObject<{
|
|
4035
4048
|
x: z.ZodNumber;
|
|
4036
4049
|
y: z.ZodNumber;
|
|
@@ -4049,6 +4062,7 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
4049
4062
|
y: number;
|
|
4050
4063
|
}[];
|
|
4051
4064
|
layermask: number;
|
|
4065
|
+
pathData: string;
|
|
4052
4066
|
fillStyle: string;
|
|
4053
4067
|
id?: string | undefined;
|
|
4054
4068
|
layer?: number | undefined;
|
|
@@ -4056,6 +4070,7 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
4056
4070
|
type: "SOLIDREGION";
|
|
4057
4071
|
points: any[];
|
|
4058
4072
|
layermask: number;
|
|
4073
|
+
pathData: string;
|
|
4059
4074
|
id?: string | undefined;
|
|
4060
4075
|
layer?: number | undefined;
|
|
4061
4076
|
fillStyle?: string | undefined;
|
|
@@ -4339,6 +4354,7 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
4339
4354
|
y: number;
|
|
4340
4355
|
}[];
|
|
4341
4356
|
layermask: number;
|
|
4357
|
+
pathData: string;
|
|
4342
4358
|
fillStyle: string;
|
|
4343
4359
|
id?: string | undefined;
|
|
4344
4360
|
layer?: number | undefined;
|
|
@@ -4534,6 +4550,7 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
4534
4550
|
y: number;
|
|
4535
4551
|
}[];
|
|
4536
4552
|
layermask: number;
|
|
4553
|
+
pathData: string;
|
|
4537
4554
|
fillStyle: string;
|
|
4538
4555
|
id?: string | undefined;
|
|
4539
4556
|
layer?: number | undefined;
|
|
@@ -4801,9 +4818,9 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
4801
4818
|
y: number;
|
|
4802
4819
|
};
|
|
4803
4820
|
radius: number;
|
|
4821
|
+
pathData: string;
|
|
4804
4822
|
lineWidth: number;
|
|
4805
4823
|
sweepFlag: boolean;
|
|
4806
|
-
pathData: string;
|
|
4807
4824
|
color: string;
|
|
4808
4825
|
} | {
|
|
4809
4826
|
path: string;
|
|
@@ -4982,6 +4999,7 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
4982
4999
|
y: number;
|
|
4983
5000
|
}[];
|
|
4984
5001
|
layermask: number;
|
|
5002
|
+
pathData: string;
|
|
4985
5003
|
fillStyle: string;
|
|
4986
5004
|
id?: string | undefined;
|
|
4987
5005
|
layer?: number | undefined;
|
package/dist/index.js
CHANGED
|
@@ -6193,7 +6193,7 @@ var normalizeSymbolName = (name) => {
|
|
|
6193
6193
|
const trimmedName = name.trim();
|
|
6194
6194
|
if (trimmedName === "+") return "_POS";
|
|
6195
6195
|
if (trimmedName === "-") return "_NEG";
|
|
6196
|
-
return trimmedName;
|
|
6196
|
+
return trimmedName.replace(/(?<=[A-Za-z0-9])-(?=[A-Za-z0-9])/g, "_");
|
|
6197
6197
|
};
|
|
6198
6198
|
|
|
6199
6199
|
// lib/websafe/convert-to-typescript-component/category-value-contains-diode.ts
|
|
@@ -6474,6 +6474,62 @@ var handleFabricationNotePath = (track, index) => pcb_fabrication_note_path.pars
|
|
|
6474
6474
|
})),
|
|
6475
6475
|
stroke_width: mil10ToMm(track.width)
|
|
6476
6476
|
});
|
|
6477
|
+
var handleFabricationNoteSolidRegion = (solidRegion, index) => {
|
|
6478
|
+
const rawRoute = [];
|
|
6479
|
+
let currentPoint;
|
|
6480
|
+
for (const commandMatch of solidRegion.pathData.matchAll(
|
|
6481
|
+
/([MLAZ])([^MLAZ]*)/gi
|
|
6482
|
+
)) {
|
|
6483
|
+
const command = commandMatch[1]?.toUpperCase();
|
|
6484
|
+
const values = commandMatch[2]?.match(/[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g)?.map(Number) ?? [];
|
|
6485
|
+
if ((command === "M" || command === "L") && values.length >= 2) {
|
|
6486
|
+
currentPoint = { x: values[0], y: values[1] };
|
|
6487
|
+
rawRoute.push(currentPoint);
|
|
6488
|
+
} else if (command === "A" && currentPoint && values.length >= 7) {
|
|
6489
|
+
const [radiusX, , , largeArcFlag, sweepFlag, endX, endY] = values;
|
|
6490
|
+
const generatedArcRoute = generateArcFromSweep(
|
|
6491
|
+
currentPoint.x,
|
|
6492
|
+
currentPoint.y,
|
|
6493
|
+
endX,
|
|
6494
|
+
endY,
|
|
6495
|
+
radiusX,
|
|
6496
|
+
largeArcFlag === 1,
|
|
6497
|
+
sweepFlag === 1
|
|
6498
|
+
);
|
|
6499
|
+
const maxArcSegments = 16;
|
|
6500
|
+
const arcRoute = generatedArcRoute.length <= maxArcSegments + 1 ? generatedArcRoute : Array.from(
|
|
6501
|
+
{ length: maxArcSegments + 1 },
|
|
6502
|
+
(_, pointIndex) => generatedArcRoute.at(
|
|
6503
|
+
Math.round(
|
|
6504
|
+
pointIndex * (generatedArcRoute.length - 1) / maxArcSegments
|
|
6505
|
+
)
|
|
6506
|
+
)
|
|
6507
|
+
).filter((point2) => !!point2);
|
|
6508
|
+
rawRoute.push(...arcRoute.slice(1));
|
|
6509
|
+
currentPoint = { x: endX, y: endY };
|
|
6510
|
+
}
|
|
6511
|
+
}
|
|
6512
|
+
const route = rawRoute.map((point2) => ({
|
|
6513
|
+
x: mil10ToMm(point2.x),
|
|
6514
|
+
y: mil10ToMm(point2.y)
|
|
6515
|
+
}));
|
|
6516
|
+
const firstPoint = route[0];
|
|
6517
|
+
const lastPoint = route.at(-1);
|
|
6518
|
+
if (firstPoint && lastPoint && (firstPoint.x !== lastPoint.x || firstPoint.y !== lastPoint.y)) {
|
|
6519
|
+
route.push({ ...firstPoint });
|
|
6520
|
+
}
|
|
6521
|
+
if (route.length < 2) return null;
|
|
6522
|
+
return pcb_fabrication_note_path.parse({
|
|
6523
|
+
type: "pcb_fabrication_note_path",
|
|
6524
|
+
pcb_fabrication_note_path_id: `pcb_fabrication_note_solid_region_${index + 1}`,
|
|
6525
|
+
pcb_component_id: "pcb_component_1",
|
|
6526
|
+
layer: "top",
|
|
6527
|
+
route,
|
|
6528
|
+
// EasyEDA solid regions have no stroke width. Use its standard 1-unit
|
|
6529
|
+
// document stroke so the closed region remains visible as a note path.
|
|
6530
|
+
stroke_width: mil10ToMm(1)
|
|
6531
|
+
});
|
|
6532
|
+
};
|
|
6477
6533
|
var getSideFromLayer = (layer) => {
|
|
6478
6534
|
if (layer === 4 || layer === 14) return "bottom";
|
|
6479
6535
|
return "top";
|
|
@@ -6844,6 +6900,9 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
|
|
|
6844
6900
|
} else if (isDocumentLayer(shape.layer)) {
|
|
6845
6901
|
circuitElements.push(handleFabricationNotePath(shape, index));
|
|
6846
6902
|
}
|
|
6903
|
+
} else if (shape.type === "SOLIDREGION" && isDocumentLayer(shape.layermask)) {
|
|
6904
|
+
const fabricationNote = handleFabricationNoteSolidRegion(shape, index);
|
|
6905
|
+
if (fabricationNote) circuitElements.push(fabricationNote);
|
|
6847
6906
|
} else if (shape.type === "CIRCLE") {
|
|
6848
6907
|
if (isSilkscreenLayer(shape.layer)) {
|
|
6849
6908
|
circuitElements.push(handleSilkscreenCircle(shape, index));
|
|
@@ -7331,6 +7390,7 @@ var CircleSchema = BaseShapeSchema.extend({
|
|
|
7331
7390
|
var SolidRegionSchema = BaseShapeSchema.extend({
|
|
7332
7391
|
type: z193.literal("SOLIDREGION"),
|
|
7333
7392
|
layermask: z193.number(),
|
|
7393
|
+
pathData: z193.string(),
|
|
7334
7394
|
points: z193.array(PointSchema),
|
|
7335
7395
|
fillStyle: z193.string().default("none")
|
|
7336
7396
|
});
|
|
@@ -7525,6 +7585,7 @@ var ShapeItemSchema = z193.object({
|
|
|
7525
7585
|
return SolidRegionSchema.parse({
|
|
7526
7586
|
type: "SOLIDREGION",
|
|
7527
7587
|
layermask: Number(layermask),
|
|
7588
|
+
pathData,
|
|
7528
7589
|
points,
|
|
7529
7590
|
fillStyle: fillStyle || void 0,
|
|
7530
7591
|
id
|
|
@@ -8178,6 +8239,9 @@ var mapPortHints = (portHints, portHintsMap) => {
|
|
|
8178
8239
|
if (!portHintsMap || !portHints) return portHints;
|
|
8179
8240
|
return [...new Set(portHints.flatMap((hint) => portHintsMap[hint] ?? [hint]))];
|
|
8180
8241
|
};
|
|
8242
|
+
var getLayerAttr = (layer) => layer && layer !== "top" ? ` layer="${layer}"` : "";
|
|
8243
|
+
var getRotationAttr = (rotation2) => rotation2 ? ` pcbRotation="${rotation2}deg"` : "";
|
|
8244
|
+
var getStringAttr = (name, value) => value === void 0 ? "" : ` ${name}=${JSON.stringify(value)}`;
|
|
8181
8245
|
var generateFootprintTsx = (circuitJson, options = {}) => {
|
|
8182
8246
|
const holes = su(circuitJson).pcb_hole.list();
|
|
8183
8247
|
const platedHoles = su(circuitJson).pcb_plated_hole.list();
|
|
@@ -8188,6 +8252,14 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
|
|
|
8188
8252
|
const silkscreenRects = su(circuitJson).pcb_silkscreen_rect.list();
|
|
8189
8253
|
const silkscreenTexts = su(circuitJson).pcb_silkscreen_text.list();
|
|
8190
8254
|
const fabricationNotePaths = su(circuitJson).pcb_fabrication_note_path.list();
|
|
8255
|
+
const fabricationNoteTexts = su(circuitJson).pcb_fabrication_note_text.list();
|
|
8256
|
+
const fabricationNoteRects = su(circuitJson).pcb_fabrication_note_rect.list();
|
|
8257
|
+
const fabricationNoteDimensions = su(circuitJson).pcb_fabrication_note_dimension.list();
|
|
8258
|
+
const pcbNoteTexts = su(circuitJson).pcb_note_text.list();
|
|
8259
|
+
const pcbNoteRects = su(circuitJson).pcb_note_rect.list();
|
|
8260
|
+
const pcbNotePaths = su(circuitJson).pcb_note_path.list();
|
|
8261
|
+
const pcbNoteLines = su(circuitJson).pcb_note_line.list();
|
|
8262
|
+
const pcbNoteDimensions = su(circuitJson).pcb_note_dimension.list();
|
|
8191
8263
|
const courtyardOutlines = su(circuitJson).pcb_courtyard_outline.list();
|
|
8192
8264
|
const elementStrings = [];
|
|
8193
8265
|
for (const hole of holes) {
|
|
@@ -8280,7 +8352,49 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
|
|
|
8280
8352
|
}
|
|
8281
8353
|
for (const fabricationNotePath of fabricationNotePaths) {
|
|
8282
8354
|
elementStrings.push(
|
|
8283
|
-
`<fabricationnotepath route={${JSON.stringify(fabricationNotePath.route)}} strokeWidth="${mmStr(fabricationNotePath.stroke_width)}" />`
|
|
8355
|
+
`<fabricationnotepath route={${JSON.stringify(fabricationNotePath.route)}} strokeWidth="${mmStr(fabricationNotePath.stroke_width)}"${getStringAttr("color", fabricationNotePath.color)}${getLayerAttr(fabricationNotePath.layer)} />`
|
|
8356
|
+
);
|
|
8357
|
+
}
|
|
8358
|
+
for (const fabricationNoteText of fabricationNoteTexts) {
|
|
8359
|
+
elementStrings.push(
|
|
8360
|
+
`<fabricationnotetext text=${JSON.stringify(fabricationNoteText.text)} pcbX="${mmStr(fabricationNoteText.anchor_position.x)}" pcbY="${mmStr(fabricationNoteText.anchor_position.y)}" anchorAlignment="${fabricationNoteText.anchor_alignment}"${getStringAttr("font", fabricationNoteText.font)}${fabricationNoteText.font_size === void 0 ? "" : ` fontSize="${mmStr(fabricationNoteText.font_size)}"`}${getStringAttr("color", fabricationNoteText.color)}${getRotationAttr(fabricationNoteText.ccw_rotation)}${getLayerAttr(fabricationNoteText.layer)} />`
|
|
8361
|
+
);
|
|
8362
|
+
}
|
|
8363
|
+
for (const fabricationNoteRect of fabricationNoteRects) {
|
|
8364
|
+
elementStrings.push(
|
|
8365
|
+
`<fabricationnoterect pcbX="${mmStr(fabricationNoteRect.center.x)}" pcbY="${mmStr(fabricationNoteRect.center.y)}" width="${mmStr(fabricationNoteRect.width)}" height="${mmStr(fabricationNoteRect.height)}" strokeWidth="${mmStr(fabricationNoteRect.stroke_width)}"${fabricationNoteRect.corner_radius === void 0 ? "" : ` cornerRadius="${mmStr(fabricationNoteRect.corner_radius)}"`}${fabricationNoteRect.is_filled === void 0 ? "" : ` isFilled={${fabricationNoteRect.is_filled}}`}${fabricationNoteRect.has_stroke === void 0 ? "" : ` hasStroke={${fabricationNoteRect.has_stroke}}`}${fabricationNoteRect.is_stroke_dashed === void 0 ? "" : ` isStrokeDashed={${fabricationNoteRect.is_stroke_dashed}}`}${getStringAttr("color", fabricationNoteRect.color)}${getLayerAttr(fabricationNoteRect.layer)} />`
|
|
8366
|
+
);
|
|
8367
|
+
}
|
|
8368
|
+
for (const fabricationNoteDimension of fabricationNoteDimensions) {
|
|
8369
|
+
const offset = "offset" in fabricationNoteDimension ? fabricationNoteDimension.offset : fabricationNoteDimension.offset_distance;
|
|
8370
|
+
elementStrings.push(
|
|
8371
|
+
`<fabricationnotedimension from={${JSON.stringify(fabricationNoteDimension.from)}} to={${JSON.stringify(fabricationNoteDimension.to)}}${getStringAttr("text", fabricationNoteDimension.text)}${getStringAttr("font", fabricationNoteDimension.font)}${fabricationNoteDimension.font_size === void 0 ? "" : ` fontSize="${mmStr(fabricationNoteDimension.font_size)}"`}${fabricationNoteDimension.arrow_size === void 0 ? "" : ` arrowSize="${mmStr(fabricationNoteDimension.arrow_size)}"`}${offset === void 0 ? "" : ` offset="${mmStr(offset)}"`}${getStringAttr("color", fabricationNoteDimension.color)}${getLayerAttr(fabricationNoteDimension.layer)} />`
|
|
8372
|
+
);
|
|
8373
|
+
}
|
|
8374
|
+
for (const pcbNoteText of pcbNoteTexts) {
|
|
8375
|
+
elementStrings.push(
|
|
8376
|
+
`<pcbnotetext text=${JSON.stringify(pcbNoteText.text ?? "")} pcbX="${mmStr(pcbNoteText.anchor_position.x)}" pcbY="${mmStr(pcbNoteText.anchor_position.y)}" anchorAlignment="${pcbNoteText.anchor_alignment}"${getStringAttr("font", pcbNoteText.font)}${pcbNoteText.font_size === void 0 ? "" : ` fontSize="${mmStr(pcbNoteText.font_size)}"`}${getStringAttr("color", pcbNoteText.color)}${getLayerAttr(pcbNoteText.layer)} />`
|
|
8377
|
+
);
|
|
8378
|
+
}
|
|
8379
|
+
for (const pcbNoteRect of pcbNoteRects) {
|
|
8380
|
+
elementStrings.push(
|
|
8381
|
+
`<pcbnoterect pcbX="${mmStr(pcbNoteRect.center.x)}" pcbY="${mmStr(pcbNoteRect.center.y)}" width="${mmStr(pcbNoteRect.width)}" height="${mmStr(pcbNoteRect.height)}" strokeWidth="${mmStr(pcbNoteRect.stroke_width)}"${pcbNoteRect.corner_radius === void 0 ? "" : ` cornerRadius="${mmStr(pcbNoteRect.corner_radius)}"`}${pcbNoteRect.is_filled === void 0 ? "" : ` isFilled={${pcbNoteRect.is_filled}}`}${pcbNoteRect.has_stroke === void 0 ? "" : ` hasStroke={${pcbNoteRect.has_stroke}}`}${pcbNoteRect.is_stroke_dashed === void 0 ? "" : ` isStrokeDashed={${pcbNoteRect.is_stroke_dashed}}`}${getStringAttr("color", pcbNoteRect.color)}${getLayerAttr(pcbNoteRect.layer)} />`
|
|
8382
|
+
);
|
|
8383
|
+
}
|
|
8384
|
+
for (const pcbNotePath of pcbNotePaths) {
|
|
8385
|
+
elementStrings.push(
|
|
8386
|
+
`<pcbnotepath route={${JSON.stringify(pcbNotePath.route)}} strokeWidth="${mmStr(pcbNotePath.stroke_width)}"${getStringAttr("color", pcbNotePath.color)}${getLayerAttr(pcbNotePath.layer)} />`
|
|
8387
|
+
);
|
|
8388
|
+
}
|
|
8389
|
+
for (const pcbNoteLine of pcbNoteLines) {
|
|
8390
|
+
elementStrings.push(
|
|
8391
|
+
`<pcbnoteline x1="${mmStr(pcbNoteLine.x1)}" y1="${mmStr(pcbNoteLine.y1)}" x2="${mmStr(pcbNoteLine.x2)}" y2="${mmStr(pcbNoteLine.y2)}" strokeWidth="${mmStr(pcbNoteLine.stroke_width)}"${pcbNoteLine.is_dashed === void 0 ? "" : ` isDashed={${pcbNoteLine.is_dashed}}`}${getStringAttr("color", pcbNoteLine.color)}${getLayerAttr(pcbNoteLine.layer)} />`
|
|
8392
|
+
);
|
|
8393
|
+
}
|
|
8394
|
+
for (const pcbNoteDimension of pcbNoteDimensions) {
|
|
8395
|
+
const offset = pcbNoteDimension.offset_distance;
|
|
8396
|
+
elementStrings.push(
|
|
8397
|
+
`<pcbnotedimension from={${JSON.stringify(pcbNoteDimension.from)}} to={${JSON.stringify(pcbNoteDimension.to)}}${getStringAttr("text", pcbNoteDimension.text)}${getStringAttr("font", pcbNoteDimension.font)}${pcbNoteDimension.font_size === void 0 ? "" : ` fontSize="${mmStr(pcbNoteDimension.font_size)}"`}${pcbNoteDimension.arrow_size === void 0 ? "" : ` arrowSize="${mmStr(pcbNoteDimension.arrow_size)}"`}${offset === void 0 ? "" : ` offset="${mmStr(offset)}"`}${getStringAttr("color", pcbNoteDimension.color)}${getLayerAttr(pcbNoteDimension.layer)} />`
|
|
8284
8398
|
);
|
|
8285
8399
|
}
|
|
8286
8400
|
for (const courtyardOutline of courtyardOutlines) {
|