kicadts 0.0.38 → 0.0.40
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.d.ts +148 -48
- package/dist/index.js +625 -259
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6553,6 +6553,14 @@ var FootprintSolderPasteRatio = class extends SxPrimitiveNumber {
|
|
|
6553
6553
|
};
|
|
6554
6554
|
SxClass.register(FootprintSolderPasteRatio);
|
|
6555
6555
|
|
|
6556
|
+
// lib/sexpr/classes/FootprintSolderPasteMarginRatio.ts
|
|
6557
|
+
var FootprintSolderPasteMarginRatio = class extends FootprintSolderPasteRatio {
|
|
6558
|
+
static token = "solder_paste_margin_ratio";
|
|
6559
|
+
static parentToken = "footprint";
|
|
6560
|
+
token = "solder_paste_margin_ratio";
|
|
6561
|
+
};
|
|
6562
|
+
SxClass.register(FootprintSolderPasteMarginRatio);
|
|
6563
|
+
|
|
6556
6564
|
// lib/sexpr/classes/FootprintTags.ts
|
|
6557
6565
|
var FootprintTags = class _FootprintTags extends SxClass {
|
|
6558
6566
|
static token = "tags";
|
|
@@ -8140,7 +8148,8 @@ var NUMERIC_TOKENS = /* @__PURE__ */ new Map([
|
|
|
8140
8148
|
["max_length", "maxLength"],
|
|
8141
8149
|
["best_width_ratio", "bestWidthRatio"],
|
|
8142
8150
|
["max_width", "maxWidth"],
|
|
8143
|
-
["filter_ratio", "filterRatio"]
|
|
8151
|
+
["filter_ratio", "filterRatio"],
|
|
8152
|
+
["curve_points", "curvePoints"]
|
|
8144
8153
|
]);
|
|
8145
8154
|
var BOOLEAN_TOKENS = /* @__PURE__ */ new Map([
|
|
8146
8155
|
["curved_edges", "curvedEdges"],
|
|
@@ -8157,6 +8166,7 @@ var PadTeardrops = class _PadTeardrops extends SxClass {
|
|
|
8157
8166
|
_bestWidthRatio;
|
|
8158
8167
|
_maxWidth;
|
|
8159
8168
|
_filterRatio;
|
|
8169
|
+
_curvePoints;
|
|
8160
8170
|
_curvedEdges;
|
|
8161
8171
|
_enabled;
|
|
8162
8172
|
_allowTwoSegments;
|
|
@@ -8231,6 +8241,12 @@ var PadTeardrops = class _PadTeardrops extends SxClass {
|
|
|
8231
8241
|
set filterRatio(value) {
|
|
8232
8242
|
this._filterRatio = value;
|
|
8233
8243
|
}
|
|
8244
|
+
get curvePoints() {
|
|
8245
|
+
return this._curvePoints;
|
|
8246
|
+
}
|
|
8247
|
+
set curvePoints(value) {
|
|
8248
|
+
this._curvePoints = value;
|
|
8249
|
+
}
|
|
8234
8250
|
get curvedEdges() {
|
|
8235
8251
|
return this._curvedEdges;
|
|
8236
8252
|
}
|
|
@@ -8278,6 +8294,9 @@ var PadTeardrops = class _PadTeardrops extends SxClass {
|
|
|
8278
8294
|
if (this._filterRatio !== void 0) {
|
|
8279
8295
|
lines.push(` (filter_ratio ${this._filterRatio})`);
|
|
8280
8296
|
}
|
|
8297
|
+
if (this._curvePoints !== void 0) {
|
|
8298
|
+
lines.push(` (curve_points ${this._curvePoints})`);
|
|
8299
|
+
}
|
|
8281
8300
|
if (this._enabled !== void 0) {
|
|
8282
8301
|
lines.push(` (enabled ${this._enabled ? "yes" : "no"})`);
|
|
8283
8302
|
}
|
|
@@ -10493,6 +10512,225 @@ var FpArcEnd = class _FpArcEnd extends SxClass {
|
|
|
10493
10512
|
};
|
|
10494
10513
|
SxClass.register(FpArcEnd);
|
|
10495
10514
|
|
|
10515
|
+
// lib/sexpr/classes/FpCurve.ts
|
|
10516
|
+
var SUPPORTED_TOKENS14 = /* @__PURE__ */ new Set([
|
|
10517
|
+
"pts",
|
|
10518
|
+
"xy",
|
|
10519
|
+
"layer",
|
|
10520
|
+
"width",
|
|
10521
|
+
"stroke",
|
|
10522
|
+
"tstamp",
|
|
10523
|
+
"uuid",
|
|
10524
|
+
"locked"
|
|
10525
|
+
]);
|
|
10526
|
+
var FpCurve = class _FpCurve extends SxClass {
|
|
10527
|
+
static token = "fp_curve";
|
|
10528
|
+
static parentToken = "footprint";
|
|
10529
|
+
token = "fp_curve";
|
|
10530
|
+
_sxPts;
|
|
10531
|
+
_sxLayer;
|
|
10532
|
+
_sxWidth;
|
|
10533
|
+
_sxStroke;
|
|
10534
|
+
_sxTstamp;
|
|
10535
|
+
_sxUuid;
|
|
10536
|
+
_locked = false;
|
|
10537
|
+
constructor(params = {}) {
|
|
10538
|
+
super();
|
|
10539
|
+
if (params.points !== void 0) this.points = params.points;
|
|
10540
|
+
if (params.layer !== void 0) this.layer = params.layer;
|
|
10541
|
+
if (params.width !== void 0) this.width = params.width;
|
|
10542
|
+
if (params.stroke !== void 0) this.stroke = params.stroke;
|
|
10543
|
+
if (params.tstamp !== void 0) this.tstamp = params.tstamp;
|
|
10544
|
+
if (params.uuid !== void 0) this.uuid = params.uuid;
|
|
10545
|
+
if (params.locked !== void 0) this.locked = params.locked;
|
|
10546
|
+
}
|
|
10547
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
10548
|
+
const fpCurve = new _FpCurve();
|
|
10549
|
+
const structuredPrimitives = [];
|
|
10550
|
+
for (const primitive of primitiveSexprs) {
|
|
10551
|
+
if (typeof primitive === "string") {
|
|
10552
|
+
if (primitive === "locked") {
|
|
10553
|
+
if (fpCurve._locked) {
|
|
10554
|
+
throw new Error("fp_curve encountered duplicate locked flags");
|
|
10555
|
+
}
|
|
10556
|
+
fpCurve._locked = true;
|
|
10557
|
+
continue;
|
|
10558
|
+
}
|
|
10559
|
+
throw new Error(`fp_curve encountered unsupported flag "${primitive}"`);
|
|
10560
|
+
}
|
|
10561
|
+
if (!Array.isArray(primitive) || primitive.length === 0) {
|
|
10562
|
+
throw new Error(
|
|
10563
|
+
`fp_curve encountered invalid child expression: ${JSON.stringify(primitive)}`
|
|
10564
|
+
);
|
|
10565
|
+
}
|
|
10566
|
+
structuredPrimitives.push(primitive);
|
|
10567
|
+
}
|
|
10568
|
+
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(structuredPrimitives, this.token);
|
|
10569
|
+
for (const token of Object.keys(propertyMap)) {
|
|
10570
|
+
if (!SUPPORTED_TOKENS14.has(token)) {
|
|
10571
|
+
throw new Error(
|
|
10572
|
+
`fp_curve encountered unsupported child token "${token}"`
|
|
10573
|
+
);
|
|
10574
|
+
}
|
|
10575
|
+
}
|
|
10576
|
+
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
10577
|
+
if (!SUPPORTED_TOKENS14.has(token)) {
|
|
10578
|
+
throw new Error(
|
|
10579
|
+
`fp_curve encountered unsupported child token "${token}"`
|
|
10580
|
+
);
|
|
10581
|
+
}
|
|
10582
|
+
if (token !== "xy" && entries.length > 1) {
|
|
10583
|
+
throw new Error(
|
|
10584
|
+
`fp_curve does not support repeated child token "${token}"`
|
|
10585
|
+
);
|
|
10586
|
+
}
|
|
10587
|
+
}
|
|
10588
|
+
const ptsEntries = arrayPropertyMap.pts;
|
|
10589
|
+
const xyEntries = arrayPropertyMap.xy;
|
|
10590
|
+
let pts = propertyMap.pts;
|
|
10591
|
+
if (pts && xyEntries && xyEntries.length > 0) {
|
|
10592
|
+
throw new Error("fp_curve cannot mix pts and xy child tokens");
|
|
10593
|
+
}
|
|
10594
|
+
if (!pts && ptsEntries?.length) {
|
|
10595
|
+
pts = ptsEntries[0];
|
|
10596
|
+
}
|
|
10597
|
+
if (!pts && xyEntries && xyEntries.length > 0) {
|
|
10598
|
+
pts = new Pts(xyEntries);
|
|
10599
|
+
}
|
|
10600
|
+
fpCurve._sxPts = pts;
|
|
10601
|
+
fpCurve._sxLayer = propertyMap.layer;
|
|
10602
|
+
fpCurve._sxWidth = propertyMap.width;
|
|
10603
|
+
fpCurve._sxStroke = propertyMap.stroke;
|
|
10604
|
+
fpCurve._sxTstamp = propertyMap.tstamp;
|
|
10605
|
+
fpCurve._sxUuid = propertyMap.uuid;
|
|
10606
|
+
const locked = propertyMap.locked;
|
|
10607
|
+
fpCurve._locked = fpCurve._locked || (locked?.value ?? false);
|
|
10608
|
+
if (!fpCurve._sxPts) {
|
|
10609
|
+
throw new Error("fp_curve requires pts or xy child tokens");
|
|
10610
|
+
}
|
|
10611
|
+
if (!fpCurve._sxLayer) {
|
|
10612
|
+
throw new Error("fp_curve requires a layer child token");
|
|
10613
|
+
}
|
|
10614
|
+
return fpCurve;
|
|
10615
|
+
}
|
|
10616
|
+
get points() {
|
|
10617
|
+
return this._sxPts;
|
|
10618
|
+
}
|
|
10619
|
+
set points(value) {
|
|
10620
|
+
if (value === void 0) {
|
|
10621
|
+
this._sxPts = void 0;
|
|
10622
|
+
return;
|
|
10623
|
+
}
|
|
10624
|
+
if (value instanceof Pts) {
|
|
10625
|
+
this._sxPts = value;
|
|
10626
|
+
return;
|
|
10627
|
+
}
|
|
10628
|
+
if (Array.isArray(value) && value.every((point) => point instanceof Xy)) {
|
|
10629
|
+
this._sxPts = new Pts(value);
|
|
10630
|
+
return;
|
|
10631
|
+
}
|
|
10632
|
+
if (Array.isArray(value)) {
|
|
10633
|
+
this._sxPts = new Pts(value.map(({ x, y }) => new Xy(x, y)));
|
|
10634
|
+
return;
|
|
10635
|
+
}
|
|
10636
|
+
throw new Error("Unsupported points value provided to fp_curve");
|
|
10637
|
+
}
|
|
10638
|
+
get layer() {
|
|
10639
|
+
return this._sxLayer;
|
|
10640
|
+
}
|
|
10641
|
+
set layer(value) {
|
|
10642
|
+
if (value === void 0) {
|
|
10643
|
+
this._sxLayer = void 0;
|
|
10644
|
+
return;
|
|
10645
|
+
}
|
|
10646
|
+
if (value instanceof Layer) {
|
|
10647
|
+
this._sxLayer = value;
|
|
10648
|
+
return;
|
|
10649
|
+
}
|
|
10650
|
+
const names = Array.isArray(value) ? value : [value];
|
|
10651
|
+
this._sxLayer = new Layer(names);
|
|
10652
|
+
}
|
|
10653
|
+
get width() {
|
|
10654
|
+
return this._sxWidth?.value;
|
|
10655
|
+
}
|
|
10656
|
+
set width(value) {
|
|
10657
|
+
if (value === void 0) {
|
|
10658
|
+
this._sxWidth = void 0;
|
|
10659
|
+
return;
|
|
10660
|
+
}
|
|
10661
|
+
this._sxWidth = value instanceof Width ? value : new Width(value);
|
|
10662
|
+
}
|
|
10663
|
+
get stroke() {
|
|
10664
|
+
return this._sxStroke;
|
|
10665
|
+
}
|
|
10666
|
+
set stroke(value) {
|
|
10667
|
+
this._sxStroke = value;
|
|
10668
|
+
}
|
|
10669
|
+
get tstamp() {
|
|
10670
|
+
return this._sxTstamp;
|
|
10671
|
+
}
|
|
10672
|
+
set tstamp(value) {
|
|
10673
|
+
if (value === void 0) {
|
|
10674
|
+
this._sxTstamp = void 0;
|
|
10675
|
+
return;
|
|
10676
|
+
}
|
|
10677
|
+
this._sxTstamp = value instanceof Tstamp ? value : new Tstamp(value);
|
|
10678
|
+
}
|
|
10679
|
+
get uuid() {
|
|
10680
|
+
return this._sxUuid;
|
|
10681
|
+
}
|
|
10682
|
+
set uuid(value) {
|
|
10683
|
+
if (value === void 0) {
|
|
10684
|
+
this._sxUuid = void 0;
|
|
10685
|
+
return;
|
|
10686
|
+
}
|
|
10687
|
+
this._sxUuid = value instanceof Uuid ? value : new Uuid(value);
|
|
10688
|
+
}
|
|
10689
|
+
get locked() {
|
|
10690
|
+
return this._locked;
|
|
10691
|
+
}
|
|
10692
|
+
set locked(value) {
|
|
10693
|
+
this._locked = value;
|
|
10694
|
+
}
|
|
10695
|
+
getChildren() {
|
|
10696
|
+
const children = [];
|
|
10697
|
+
if (this._sxPts) children.push(this._sxPts);
|
|
10698
|
+
if (this._sxStroke) {
|
|
10699
|
+
children.push(this._sxStroke);
|
|
10700
|
+
} else if (this._sxWidth) {
|
|
10701
|
+
children.push(this._sxWidth);
|
|
10702
|
+
}
|
|
10703
|
+
if (this._sxLayer) children.push(this._sxLayer);
|
|
10704
|
+
if (this._sxTstamp) children.push(this._sxTstamp);
|
|
10705
|
+
if (this._sxUuid) children.push(this._sxUuid);
|
|
10706
|
+
if (this._locked) children.push(new FpCurveLocked(true));
|
|
10707
|
+
return children;
|
|
10708
|
+
}
|
|
10709
|
+
};
|
|
10710
|
+
SxClass.register(FpCurve);
|
|
10711
|
+
var FpCurveLocked = class _FpCurveLocked extends SxClass {
|
|
10712
|
+
constructor(value = true) {
|
|
10713
|
+
super();
|
|
10714
|
+
this.value = value;
|
|
10715
|
+
}
|
|
10716
|
+
value;
|
|
10717
|
+
static token = "locked";
|
|
10718
|
+
static parentToken = "fp_curve";
|
|
10719
|
+
token = "locked";
|
|
10720
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
10721
|
+
if (primitiveSexprs.length === 0) {
|
|
10722
|
+
return new _FpCurveLocked(true);
|
|
10723
|
+
}
|
|
10724
|
+
return new _FpCurveLocked(
|
|
10725
|
+
primitiveSexprs[0] === true || primitiveSexprs[0] === "yes" || primitiveSexprs[0] === "true"
|
|
10726
|
+
);
|
|
10727
|
+
}
|
|
10728
|
+
getString() {
|
|
10729
|
+
return "(locked)";
|
|
10730
|
+
}
|
|
10731
|
+
};
|
|
10732
|
+
SxClass.register(FpCurveLocked);
|
|
10733
|
+
|
|
10496
10734
|
// lib/sexpr/classes/FpPolyFill.ts
|
|
10497
10735
|
var truthyStrings = /* @__PURE__ */ new Set(["yes", "true", "1", "solid"]);
|
|
10498
10736
|
var FpPolyFill = class _FpPolyFill extends SxClass {
|
|
@@ -10562,7 +10800,7 @@ var FpPolyLocked = class _FpPolyLocked extends SxPrimitiveBoolean {
|
|
|
10562
10800
|
SxClass.register(FpPolyLocked);
|
|
10563
10801
|
|
|
10564
10802
|
// lib/sexpr/classes/FpPoly.ts
|
|
10565
|
-
var
|
|
10803
|
+
var SUPPORTED_TOKENS15 = /* @__PURE__ */ new Set([
|
|
10566
10804
|
"pts",
|
|
10567
10805
|
"xy",
|
|
10568
10806
|
"layer",
|
|
@@ -10600,12 +10838,12 @@ var FpPoly = class _FpPoly extends SxClass {
|
|
|
10600
10838
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
10601
10839
|
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
10602
10840
|
for (const token of Object.keys(propertyMap)) {
|
|
10603
|
-
if (!
|
|
10841
|
+
if (!SUPPORTED_TOKENS15.has(token)) {
|
|
10604
10842
|
unexpectedTokens.add(token);
|
|
10605
10843
|
}
|
|
10606
10844
|
}
|
|
10607
10845
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
10608
|
-
if (!
|
|
10846
|
+
if (!SUPPORTED_TOKENS15.has(token)) {
|
|
10609
10847
|
unexpectedTokens.add(token);
|
|
10610
10848
|
}
|
|
10611
10849
|
if (token !== "xy" && arrayPropertyMap[token].length > 1) {
|
|
@@ -10659,7 +10897,7 @@ var FpPoly = class _FpPoly extends SxClass {
|
|
|
10659
10897
|
`fp_poly child token must be a string, received: ${JSON.stringify(token)}`
|
|
10660
10898
|
);
|
|
10661
10899
|
}
|
|
10662
|
-
if (!
|
|
10900
|
+
if (!SUPPORTED_TOKENS15.has(token)) {
|
|
10663
10901
|
throw new Error(
|
|
10664
10902
|
`Unsupported child token inside fp_poly expression: ${token}`
|
|
10665
10903
|
);
|
|
@@ -10798,52 +11036,216 @@ var FpPoly = class _FpPoly extends SxClass {
|
|
|
10798
11036
|
};
|
|
10799
11037
|
SxClass.register(FpPoly);
|
|
10800
11038
|
|
|
10801
|
-
// lib/sexpr/classes/
|
|
10802
|
-
var
|
|
10803
|
-
|
|
10804
|
-
static
|
|
10805
|
-
token = "
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
}
|
|
10811
|
-
static fromSexprPrimitives(primitiveSexprs) {
|
|
10812
|
-
const value = toStringValue(primitiveSexprs[0]);
|
|
10813
|
-
if (value === void 0) {
|
|
10814
|
-
throw new Error("sheetname expects a string value");
|
|
10815
|
-
}
|
|
10816
|
-
return new _FootprintSheetname(value);
|
|
10817
|
-
}
|
|
10818
|
-
get value() {
|
|
10819
|
-
return this._value;
|
|
10820
|
-
}
|
|
10821
|
-
set value(value) {
|
|
10822
|
-
this._value = value;
|
|
10823
|
-
}
|
|
10824
|
-
getChildren() {
|
|
10825
|
-
return [];
|
|
10826
|
-
}
|
|
10827
|
-
getString() {
|
|
10828
|
-
return `(sheetname ${quoteSExprString(this._value)})`;
|
|
10829
|
-
}
|
|
10830
|
-
};
|
|
10831
|
-
SxClass.register(FootprintSheetname);
|
|
10832
|
-
|
|
10833
|
-
// lib/sexpr/classes/FootprintSheetfile.ts
|
|
10834
|
-
var FootprintSheetfile = class _FootprintSheetfile extends SxClass {
|
|
10835
|
-
static token = "sheetfile";
|
|
10836
|
-
static parentToken = "footprint";
|
|
10837
|
-
token = "sheetfile";
|
|
10838
|
-
_value;
|
|
10839
|
-
constructor(value) {
|
|
11039
|
+
// lib/sexpr/classes/Group.ts
|
|
11040
|
+
var SUPPORTED_SINGLE_TOKENS4 = /* @__PURE__ */ new Set(["uuid", "locked", "members"]);
|
|
11041
|
+
var Group = class _Group extends SxClass {
|
|
11042
|
+
static token = "group";
|
|
11043
|
+
token = "group";
|
|
11044
|
+
_name = "";
|
|
11045
|
+
_sxUuid;
|
|
11046
|
+
_sxLocked;
|
|
11047
|
+
_sxMembers;
|
|
11048
|
+
constructor(params = {}) {
|
|
10840
11049
|
super();
|
|
10841
|
-
this.
|
|
11050
|
+
if (params.name !== void 0) this.name = params.name;
|
|
11051
|
+
if (params.uuid !== void 0) this.uuid = params.uuid;
|
|
11052
|
+
if (params.locked !== void 0) this.locked = params.locked;
|
|
11053
|
+
if (params.members !== void 0) this.members = params.members;
|
|
10842
11054
|
}
|
|
10843
11055
|
static fromSexprPrimitives(primitiveSexprs) {
|
|
10844
|
-
const
|
|
10845
|
-
if (
|
|
10846
|
-
|
|
11056
|
+
const group = new _Group();
|
|
11057
|
+
if (primitiveSexprs.length > 0 && typeof primitiveSexprs[0] === "string") {
|
|
11058
|
+
group._name = primitiveSexprs[0];
|
|
11059
|
+
}
|
|
11060
|
+
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(
|
|
11061
|
+
primitiveSexprs.slice(1),
|
|
11062
|
+
this.token
|
|
11063
|
+
);
|
|
11064
|
+
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
11065
|
+
for (const token of Object.keys(propertyMap)) {
|
|
11066
|
+
if (!SUPPORTED_SINGLE_TOKENS4.has(token)) {
|
|
11067
|
+
unexpectedTokens.add(token);
|
|
11068
|
+
}
|
|
11069
|
+
}
|
|
11070
|
+
for (const token of Object.keys(arrayPropertyMap)) {
|
|
11071
|
+
if (!SUPPORTED_SINGLE_TOKENS4.has(token)) {
|
|
11072
|
+
unexpectedTokens.add(token);
|
|
11073
|
+
continue;
|
|
11074
|
+
}
|
|
11075
|
+
if (arrayPropertyMap[token].length > 1) {
|
|
11076
|
+
throw new Error(
|
|
11077
|
+
`group does not support repeated child tokens: ${token}`
|
|
11078
|
+
);
|
|
11079
|
+
}
|
|
11080
|
+
}
|
|
11081
|
+
if (unexpectedTokens.size > 0) {
|
|
11082
|
+
throw new Error(
|
|
11083
|
+
`Unsupported child tokens inside group expression: ${[...unexpectedTokens].join(", ")}`
|
|
11084
|
+
);
|
|
11085
|
+
}
|
|
11086
|
+
for (const primitive of primitiveSexprs.slice(1)) {
|
|
11087
|
+
if (Array.isArray(primitive)) continue;
|
|
11088
|
+
throw new Error(
|
|
11089
|
+
`group encountered unexpected primitive child: ${JSON.stringify(primitive)}`
|
|
11090
|
+
);
|
|
11091
|
+
}
|
|
11092
|
+
group._sxUuid = propertyMap.uuid;
|
|
11093
|
+
const locked = propertyMap.locked;
|
|
11094
|
+
group._sxLocked = locked && locked.value ? locked : void 0;
|
|
11095
|
+
group._sxMembers = propertyMap.members;
|
|
11096
|
+
return group;
|
|
11097
|
+
}
|
|
11098
|
+
get name() {
|
|
11099
|
+
return this._name;
|
|
11100
|
+
}
|
|
11101
|
+
set name(value) {
|
|
11102
|
+
this._name = value;
|
|
11103
|
+
}
|
|
11104
|
+
get uuid() {
|
|
11105
|
+
return this._sxUuid?.value;
|
|
11106
|
+
}
|
|
11107
|
+
set uuid(value) {
|
|
11108
|
+
if (value === void 0) {
|
|
11109
|
+
this._sxUuid = void 0;
|
|
11110
|
+
return;
|
|
11111
|
+
}
|
|
11112
|
+
this._sxUuid = value instanceof Uuid ? value : new Uuid(value);
|
|
11113
|
+
}
|
|
11114
|
+
get uuidClass() {
|
|
11115
|
+
return this._sxUuid;
|
|
11116
|
+
}
|
|
11117
|
+
get locked() {
|
|
11118
|
+
return this._sxLocked?.value ?? false;
|
|
11119
|
+
}
|
|
11120
|
+
set locked(value) {
|
|
11121
|
+
this._sxLocked = value ? new GroupLocked(true) : void 0;
|
|
11122
|
+
}
|
|
11123
|
+
get members() {
|
|
11124
|
+
return this._sxMembers?.members ?? [];
|
|
11125
|
+
}
|
|
11126
|
+
set members(value) {
|
|
11127
|
+
this._sxMembers = new GroupMembers(value);
|
|
11128
|
+
}
|
|
11129
|
+
get membersClass() {
|
|
11130
|
+
return this._sxMembers;
|
|
11131
|
+
}
|
|
11132
|
+
getChildren() {
|
|
11133
|
+
const children = [];
|
|
11134
|
+
if (this._sxUuid) children.push(this._sxUuid);
|
|
11135
|
+
if (this._sxLocked) children.push(this._sxLocked);
|
|
11136
|
+
if (this._sxMembers) children.push(this._sxMembers);
|
|
11137
|
+
return children;
|
|
11138
|
+
}
|
|
11139
|
+
getString() {
|
|
11140
|
+
const lines = [`(group "${this._name}"`];
|
|
11141
|
+
const push = (value) => {
|
|
11142
|
+
if (!value) return;
|
|
11143
|
+
lines.push(value.getStringIndented());
|
|
11144
|
+
};
|
|
11145
|
+
push(this._sxUuid);
|
|
11146
|
+
push(this._sxLocked);
|
|
11147
|
+
push(this._sxMembers);
|
|
11148
|
+
lines.push(")");
|
|
11149
|
+
return lines.join("\n");
|
|
11150
|
+
}
|
|
11151
|
+
};
|
|
11152
|
+
SxClass.register(Group);
|
|
11153
|
+
var GroupLocked = class _GroupLocked extends SxClass {
|
|
11154
|
+
static token = "locked";
|
|
11155
|
+
static parentToken = "group";
|
|
11156
|
+
token = "locked";
|
|
11157
|
+
value;
|
|
11158
|
+
constructor(value) {
|
|
11159
|
+
super();
|
|
11160
|
+
this.value = value;
|
|
11161
|
+
}
|
|
11162
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
11163
|
+
if (primitiveSexprs.length === 0) {
|
|
11164
|
+
return new _GroupLocked(true);
|
|
11165
|
+
}
|
|
11166
|
+
const state = toStringValue(primitiveSexprs[0]);
|
|
11167
|
+
return new _GroupLocked(state === "yes");
|
|
11168
|
+
}
|
|
11169
|
+
getString() {
|
|
11170
|
+
return this.value ? "(locked yes)" : "(locked no)";
|
|
11171
|
+
}
|
|
11172
|
+
};
|
|
11173
|
+
SxClass.register(GroupLocked);
|
|
11174
|
+
var GroupMembers = class _GroupMembers extends SxClass {
|
|
11175
|
+
static token = "members";
|
|
11176
|
+
static parentToken = "group";
|
|
11177
|
+
token = "members";
|
|
11178
|
+
members;
|
|
11179
|
+
constructor(members) {
|
|
11180
|
+
super();
|
|
11181
|
+
this.members = members;
|
|
11182
|
+
}
|
|
11183
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
11184
|
+
const members = [];
|
|
11185
|
+
for (const primitive of primitiveSexprs) {
|
|
11186
|
+
const str = toStringValue(primitive);
|
|
11187
|
+
if (str) {
|
|
11188
|
+
members.push(str);
|
|
11189
|
+
}
|
|
11190
|
+
}
|
|
11191
|
+
return new _GroupMembers(members);
|
|
11192
|
+
}
|
|
11193
|
+
getString() {
|
|
11194
|
+
if (this.members.length === 0) {
|
|
11195
|
+
return "(members)";
|
|
11196
|
+
}
|
|
11197
|
+
const memberStrings = this.members.map((m) => `"${m}"`).join(" ");
|
|
11198
|
+
return `(members ${memberStrings})`;
|
|
11199
|
+
}
|
|
11200
|
+
};
|
|
11201
|
+
SxClass.register(GroupMembers);
|
|
11202
|
+
|
|
11203
|
+
// lib/sexpr/classes/FootprintSheetname.ts
|
|
11204
|
+
var FootprintSheetname = class _FootprintSheetname extends SxClass {
|
|
11205
|
+
static token = "sheetname";
|
|
11206
|
+
static parentToken = "footprint";
|
|
11207
|
+
token = "sheetname";
|
|
11208
|
+
_value;
|
|
11209
|
+
constructor(value) {
|
|
11210
|
+
super();
|
|
11211
|
+
this._value = value;
|
|
11212
|
+
}
|
|
11213
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
11214
|
+
const value = toStringValue(primitiveSexprs[0]);
|
|
11215
|
+
if (value === void 0) {
|
|
11216
|
+
throw new Error("sheetname expects a string value");
|
|
11217
|
+
}
|
|
11218
|
+
return new _FootprintSheetname(value);
|
|
11219
|
+
}
|
|
11220
|
+
get value() {
|
|
11221
|
+
return this._value;
|
|
11222
|
+
}
|
|
11223
|
+
set value(value) {
|
|
11224
|
+
this._value = value;
|
|
11225
|
+
}
|
|
11226
|
+
getChildren() {
|
|
11227
|
+
return [];
|
|
11228
|
+
}
|
|
11229
|
+
getString() {
|
|
11230
|
+
return `(sheetname ${quoteSExprString(this._value)})`;
|
|
11231
|
+
}
|
|
11232
|
+
};
|
|
11233
|
+
SxClass.register(FootprintSheetname);
|
|
11234
|
+
|
|
11235
|
+
// lib/sexpr/classes/FootprintSheetfile.ts
|
|
11236
|
+
var FootprintSheetfile = class _FootprintSheetfile extends SxClass {
|
|
11237
|
+
static token = "sheetfile";
|
|
11238
|
+
static parentToken = "footprint";
|
|
11239
|
+
token = "sheetfile";
|
|
11240
|
+
_value;
|
|
11241
|
+
constructor(value) {
|
|
11242
|
+
super();
|
|
11243
|
+
this._value = value;
|
|
11244
|
+
}
|
|
11245
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
11246
|
+
const value = toStringValue(primitiveSexprs[0]);
|
|
11247
|
+
if (value === void 0) {
|
|
11248
|
+
throw new Error("sheetfile expects a string value");
|
|
10847
11249
|
}
|
|
10848
11250
|
return new _FootprintSheetfile(value);
|
|
10849
11251
|
}
|
|
@@ -10889,7 +11291,7 @@ var FpLineNet = class _FpLineNet extends SxClass {
|
|
|
10889
11291
|
SxClass.register(FpLineNet);
|
|
10890
11292
|
|
|
10891
11293
|
// lib/sexpr/classes/FpLine.ts
|
|
10892
|
-
var
|
|
11294
|
+
var SUPPORTED_SINGLE_TOKENS5 = /* @__PURE__ */ new Set([
|
|
10893
11295
|
"start",
|
|
10894
11296
|
"end",
|
|
10895
11297
|
"layer",
|
|
@@ -10947,14 +11349,14 @@ var FpLine = class _FpLine extends SxClass {
|
|
|
10947
11349
|
}
|
|
10948
11350
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(structuredPrimitives, this.token);
|
|
10949
11351
|
for (const token of Object.keys(propertyMap)) {
|
|
10950
|
-
if (!
|
|
11352
|
+
if (!SUPPORTED_SINGLE_TOKENS5.has(token)) {
|
|
10951
11353
|
throw new Error(
|
|
10952
11354
|
`fp_line encountered unsupported child token "${token}"`
|
|
10953
11355
|
);
|
|
10954
11356
|
}
|
|
10955
11357
|
}
|
|
10956
11358
|
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
10957
|
-
if (!
|
|
11359
|
+
if (!SUPPORTED_SINGLE_TOKENS5.has(token)) {
|
|
10958
11360
|
throw new Error(
|
|
10959
11361
|
`fp_line encountered unsupported child token "${token}"`
|
|
10960
11362
|
);
|
|
@@ -11479,7 +11881,7 @@ var EmbeddedFileType = class _EmbeddedFileType extends SxClass {
|
|
|
11479
11881
|
SxClass.register(EmbeddedFileType);
|
|
11480
11882
|
|
|
11481
11883
|
// lib/sexpr/classes/EmbeddedFile.ts
|
|
11482
|
-
var
|
|
11884
|
+
var SUPPORTED_SINGLE_TOKENS6 = /* @__PURE__ */ new Set(["name", "type", "checksum", "data"]);
|
|
11483
11885
|
var EmbeddedFile = class _EmbeddedFile extends SxClass {
|
|
11484
11886
|
static token = "file";
|
|
11485
11887
|
static parentToken = "embedded_files";
|
|
@@ -11499,12 +11901,12 @@ var EmbeddedFile = class _EmbeddedFile extends SxClass {
|
|
|
11499
11901
|
const embeddedFile = new _EmbeddedFile();
|
|
11500
11902
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
11501
11903
|
for (const token of Object.keys(propertyMap)) {
|
|
11502
|
-
if (!
|
|
11904
|
+
if (!SUPPORTED_SINGLE_TOKENS6.has(token)) {
|
|
11503
11905
|
throw new Error(`file encountered unsupported child token "${token}"`);
|
|
11504
11906
|
}
|
|
11505
11907
|
}
|
|
11506
11908
|
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
11507
|
-
if (!
|
|
11909
|
+
if (!SUPPORTED_SINGLE_TOKENS6.has(token)) {
|
|
11508
11910
|
throw new Error(`file encountered unsupported child token "${token}"`);
|
|
11509
11911
|
}
|
|
11510
11912
|
if (entries.length > 1) {
|
|
@@ -12205,12 +12607,14 @@ var ZoneFilledPolygon = class _ZoneFilledPolygon extends SxClass {
|
|
|
12205
12607
|
super();
|
|
12206
12608
|
if (params.layer !== void 0) this.layer = params.layer;
|
|
12207
12609
|
if (params.pts !== void 0) this.pts = params.pts;
|
|
12610
|
+
if (params.island !== void 0) this.island = params.island;
|
|
12208
12611
|
}
|
|
12612
|
+
_island = false;
|
|
12209
12613
|
static fromSexprPrimitives(primitiveSexprs) {
|
|
12210
12614
|
const polygon = new _ZoneFilledPolygon();
|
|
12211
12615
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
12212
12616
|
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
12213
|
-
if (token !== "layer" && token !== "pts") {
|
|
12617
|
+
if (token !== "layer" && token !== "pts" && token !== "island") {
|
|
12214
12618
|
throw new Error(
|
|
12215
12619
|
`zone filled_polygon encountered unsupported child "${token}"`
|
|
12216
12620
|
);
|
|
@@ -12223,6 +12627,8 @@ var ZoneFilledPolygon = class _ZoneFilledPolygon extends SxClass {
|
|
|
12223
12627
|
}
|
|
12224
12628
|
polygon._sxLayer = propertyMap.layer;
|
|
12225
12629
|
polygon._sxPts = propertyMap.pts;
|
|
12630
|
+
const island = propertyMap.island;
|
|
12631
|
+
polygon._island = island?.value ?? false;
|
|
12226
12632
|
return polygon;
|
|
12227
12633
|
}
|
|
12228
12634
|
get layer() {
|
|
@@ -12237,14 +12643,38 @@ var ZoneFilledPolygon = class _ZoneFilledPolygon extends SxClass {
|
|
|
12237
12643
|
set pts(value) {
|
|
12238
12644
|
this._sxPts = value;
|
|
12239
12645
|
}
|
|
12646
|
+
get island() {
|
|
12647
|
+
return this._island;
|
|
12648
|
+
}
|
|
12649
|
+
set island(value) {
|
|
12650
|
+
this._island = value;
|
|
12651
|
+
}
|
|
12240
12652
|
getChildren() {
|
|
12241
12653
|
const children = [];
|
|
12242
12654
|
if (this._sxLayer) children.push(this._sxLayer);
|
|
12655
|
+
if (this._island) children.push(new ZoneFilledPolygonIsland(true));
|
|
12243
12656
|
if (this._sxPts) children.push(this._sxPts);
|
|
12244
12657
|
return children;
|
|
12245
12658
|
}
|
|
12246
12659
|
};
|
|
12247
12660
|
SxClass.register(ZoneFilledPolygon);
|
|
12661
|
+
var ZoneFilledPolygonIsland = class _ZoneFilledPolygonIsland extends SxClass {
|
|
12662
|
+
constructor(value = true) {
|
|
12663
|
+
super();
|
|
12664
|
+
this.value = value;
|
|
12665
|
+
}
|
|
12666
|
+
value;
|
|
12667
|
+
static token = "island";
|
|
12668
|
+
static parentToken = "filled_polygon";
|
|
12669
|
+
token = "island";
|
|
12670
|
+
static fromSexprPrimitives() {
|
|
12671
|
+
return new _ZoneFilledPolygonIsland(true);
|
|
12672
|
+
}
|
|
12673
|
+
getString() {
|
|
12674
|
+
return "(island)";
|
|
12675
|
+
}
|
|
12676
|
+
};
|
|
12677
|
+
SxClass.register(ZoneFilledPolygonIsland);
|
|
12248
12678
|
|
|
12249
12679
|
// lib/sexpr/classes/ZoneHatch.ts
|
|
12250
12680
|
var ZoneHatch = class _ZoneHatch extends SxClass {
|
|
@@ -12567,7 +12997,7 @@ var SINGLE_TOKENS4 = /* @__PURE__ */ new Set([
|
|
|
12567
12997
|
"fill"
|
|
12568
12998
|
]);
|
|
12569
12999
|
var MULTI_TOKENS2 = /* @__PURE__ */ new Set(["polygon", "filled_polygon"]);
|
|
12570
|
-
var
|
|
13000
|
+
var SUPPORTED_TOKENS16 = /* @__PURE__ */ new Set([...SINGLE_TOKENS4, ...MULTI_TOKENS2]);
|
|
12571
13001
|
var Zone = class _Zone extends SxClass {
|
|
12572
13002
|
static token = "zone";
|
|
12573
13003
|
token = "zone";
|
|
@@ -12624,7 +13054,7 @@ var Zone = class _Zone extends SxClass {
|
|
|
12624
13054
|
}
|
|
12625
13055
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
12626
13056
|
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
12627
|
-
if (!
|
|
13057
|
+
if (!SUPPORTED_TOKENS16.has(token)) {
|
|
12628
13058
|
throw new Error(`zone encountered unsupported child token "${token}"`);
|
|
12629
13059
|
}
|
|
12630
13060
|
if (!MULTI_TOKENS2.has(token) && entries.length > 1) {
|
|
@@ -12822,6 +13252,7 @@ var SINGLE_TOKENS5 = /* @__PURE__ */ new Set([
|
|
|
12822
13252
|
"solder_mask_margin",
|
|
12823
13253
|
"solder_paste_margin",
|
|
12824
13254
|
"solder_paste_ratio",
|
|
13255
|
+
"solder_paste_margin_ratio",
|
|
12825
13256
|
"clearance",
|
|
12826
13257
|
"zone_connect",
|
|
12827
13258
|
"thermal_width",
|
|
@@ -12844,13 +13275,15 @@ var MULTI_TOKENS3 = /* @__PURE__ */ new Set([
|
|
|
12844
13275
|
"fp_rect",
|
|
12845
13276
|
"fp_circle",
|
|
12846
13277
|
"fp_arc",
|
|
13278
|
+
"fp_curve",
|
|
12847
13279
|
"fp_poly",
|
|
12848
13280
|
"point",
|
|
12849
13281
|
"pad",
|
|
12850
13282
|
"model",
|
|
12851
|
-
"zone"
|
|
13283
|
+
"zone",
|
|
13284
|
+
"group"
|
|
12852
13285
|
]);
|
|
12853
|
-
var
|
|
13286
|
+
var SUPPORTED_TOKENS17 = /* @__PURE__ */ new Set([...SINGLE_TOKENS5, ...MULTI_TOKENS3]);
|
|
12854
13287
|
var Footprint = class _Footprint extends SxClass {
|
|
12855
13288
|
static token = "footprint";
|
|
12856
13289
|
token = "footprint";
|
|
@@ -12894,11 +13327,13 @@ var Footprint = class _Footprint extends SxClass {
|
|
|
12894
13327
|
_fpRects = [];
|
|
12895
13328
|
_fpCircles = [];
|
|
12896
13329
|
_fpArcs = [];
|
|
13330
|
+
_fpCurves = [];
|
|
12897
13331
|
_fpPolys = [];
|
|
12898
13332
|
_points = [];
|
|
12899
13333
|
_fpPads = [];
|
|
12900
13334
|
_models = [];
|
|
12901
13335
|
_zones = [];
|
|
13336
|
+
_groups = [];
|
|
12902
13337
|
constructor(params = {}) {
|
|
12903
13338
|
super();
|
|
12904
13339
|
if (params.libraryLink !== void 0) this.libraryLink = params.libraryLink;
|
|
@@ -12925,6 +13360,8 @@ var Footprint = class _Footprint extends SxClass {
|
|
|
12925
13360
|
this.solderPasteMargin = params.solderPasteMargin;
|
|
12926
13361
|
if (params.solderPasteRatio !== void 0)
|
|
12927
13362
|
this.solderPasteRatio = params.solderPasteRatio;
|
|
13363
|
+
if (params.solderPasteMarginRatio !== void 0)
|
|
13364
|
+
this.solderPasteMarginRatio = params.solderPasteMarginRatio;
|
|
12928
13365
|
if (params.clearance !== void 0) this.clearance = params.clearance;
|
|
12929
13366
|
if (params.zoneConnect !== void 0) this.zoneConnect = params.zoneConnect;
|
|
12930
13367
|
if (params.thermalWidth !== void 0)
|
|
@@ -12952,11 +13389,13 @@ var Footprint = class _Footprint extends SxClass {
|
|
|
12952
13389
|
if (params.fpRects !== void 0) this.fpRects = params.fpRects;
|
|
12953
13390
|
if (params.fpCircles !== void 0) this.fpCircles = params.fpCircles;
|
|
12954
13391
|
if (params.fpArcs !== void 0) this.fpArcs = params.fpArcs;
|
|
13392
|
+
if (params.fpCurves !== void 0) this.fpCurves = params.fpCurves;
|
|
12955
13393
|
if (params.fpPolys !== void 0) this.fpPolys = params.fpPolys;
|
|
12956
13394
|
if (params.points !== void 0) this.points = params.points;
|
|
12957
13395
|
if (params.pads !== void 0) this.fpPads = params.pads;
|
|
12958
13396
|
if (params.models !== void 0) this.models = params.models;
|
|
12959
13397
|
if (params.zones !== void 0) this.zones = params.zones;
|
|
13398
|
+
if (params.groups !== void 0) this.groups = params.groups;
|
|
12960
13399
|
}
|
|
12961
13400
|
static fromSexprPrimitives(primitiveSexprs) {
|
|
12962
13401
|
const footprint = new _Footprint();
|
|
@@ -12982,14 +13421,14 @@ var Footprint = class _Footprint extends SxClass {
|
|
|
12982
13421
|
}
|
|
12983
13422
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(rawNodes, this.token);
|
|
12984
13423
|
for (const token of Object.keys(propertyMap)) {
|
|
12985
|
-
if (!
|
|
13424
|
+
if (!SUPPORTED_TOKENS17.has(token)) {
|
|
12986
13425
|
throw new Error(
|
|
12987
13426
|
`footprint encountered unsupported child token "${token}"`
|
|
12988
13427
|
);
|
|
12989
13428
|
}
|
|
12990
13429
|
}
|
|
12991
13430
|
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
12992
|
-
if (!
|
|
13431
|
+
if (!SUPPORTED_TOKENS17.has(token)) {
|
|
12993
13432
|
throw new Error(
|
|
12994
13433
|
`footprint encountered unsupported child token "${token}"`
|
|
12995
13434
|
);
|
|
@@ -13027,7 +13466,14 @@ var Footprint = class _Footprint extends SxClass {
|
|
|
13027
13466
|
footprint._sxAutoplaceCost180 = propertyMap.autoplace_cost180;
|
|
13028
13467
|
footprint._sxSolderMaskMargin = propertyMap.solder_mask_margin;
|
|
13029
13468
|
footprint._sxSolderPasteMargin = propertyMap.solder_paste_margin;
|
|
13030
|
-
|
|
13469
|
+
const solderPasteRatio = propertyMap.solder_paste_ratio;
|
|
13470
|
+
const solderPasteMarginRatio = propertyMap.solder_paste_margin_ratio;
|
|
13471
|
+
if (solderPasteRatio && solderPasteMarginRatio) {
|
|
13472
|
+
throw new Error(
|
|
13473
|
+
"footprint cannot include both solder_paste_ratio and solder_paste_margin_ratio children"
|
|
13474
|
+
);
|
|
13475
|
+
}
|
|
13476
|
+
footprint._sxSolderPasteRatio = solderPasteRatio ?? solderPasteMarginRatio;
|
|
13031
13477
|
footprint._sxClearance = propertyMap.clearance;
|
|
13032
13478
|
footprint._sxZoneConnect = propertyMap.zone_connect;
|
|
13033
13479
|
footprint._sxThermalWidth = propertyMap.thermal_width;
|
|
@@ -13048,11 +13494,13 @@ var Footprint = class _Footprint extends SxClass {
|
|
|
13048
13494
|
footprint._fpRects = arrayPropertyMap["fp_rect"] ?? [];
|
|
13049
13495
|
footprint._fpCircles = arrayPropertyMap["fp_circle"] ?? [];
|
|
13050
13496
|
footprint._fpArcs = arrayPropertyMap["fp_arc"] ?? [];
|
|
13497
|
+
footprint._fpCurves = arrayPropertyMap["fp_curve"] ?? [];
|
|
13051
13498
|
footprint._fpPolys = arrayPropertyMap["fp_poly"] ?? [];
|
|
13052
13499
|
footprint._points = arrayPropertyMap.point ?? [];
|
|
13053
13500
|
footprint._fpPads = arrayPropertyMap.pad ?? [];
|
|
13054
13501
|
footprint._models = arrayPropertyMap.model ?? [];
|
|
13055
13502
|
footprint._zones = arrayPropertyMap.zone ?? [];
|
|
13503
|
+
footprint._groups = arrayPropertyMap.group ?? [];
|
|
13056
13504
|
for (const flag of pendingFlags) {
|
|
13057
13505
|
if (flag === "locked") {
|
|
13058
13506
|
if (footprint._sxLocked) {
|
|
@@ -13283,6 +13731,16 @@ var Footprint = class _Footprint extends SxClass {
|
|
|
13283
13731
|
}
|
|
13284
13732
|
this._sxSolderPasteRatio = value instanceof FootprintSolderPasteRatio ? value : new FootprintSolderPasteRatio(value);
|
|
13285
13733
|
}
|
|
13734
|
+
get solderPasteMarginRatio() {
|
|
13735
|
+
return this._sxSolderPasteRatio instanceof FootprintSolderPasteMarginRatio ? this._sxSolderPasteRatio : void 0;
|
|
13736
|
+
}
|
|
13737
|
+
set solderPasteMarginRatio(value) {
|
|
13738
|
+
if (value === void 0) {
|
|
13739
|
+
this._sxSolderPasteRatio = void 0;
|
|
13740
|
+
return;
|
|
13741
|
+
}
|
|
13742
|
+
this._sxSolderPasteRatio = value instanceof FootprintSolderPasteMarginRatio ? value : new FootprintSolderPasteMarginRatio(value);
|
|
13743
|
+
}
|
|
13286
13744
|
get clearance() {
|
|
13287
13745
|
return this._sxClearance;
|
|
13288
13746
|
}
|
|
@@ -13439,6 +13897,12 @@ var Footprint = class _Footprint extends SxClass {
|
|
|
13439
13897
|
set fpArcs(value) {
|
|
13440
13898
|
this._fpArcs = [...value];
|
|
13441
13899
|
}
|
|
13900
|
+
get fpCurves() {
|
|
13901
|
+
return [...this._fpCurves];
|
|
13902
|
+
}
|
|
13903
|
+
set fpCurves(value) {
|
|
13904
|
+
this._fpCurves = [...value];
|
|
13905
|
+
}
|
|
13442
13906
|
get fpPolys() {
|
|
13443
13907
|
return [...this._fpPolys];
|
|
13444
13908
|
}
|
|
@@ -13469,6 +13933,12 @@ var Footprint = class _Footprint extends SxClass {
|
|
|
13469
13933
|
set zones(value) {
|
|
13470
13934
|
this._zones = [...value];
|
|
13471
13935
|
}
|
|
13936
|
+
get groups() {
|
|
13937
|
+
return [...this._groups];
|
|
13938
|
+
}
|
|
13939
|
+
set groups(value) {
|
|
13940
|
+
this._groups = [...value];
|
|
13941
|
+
}
|
|
13472
13942
|
getChildren() {
|
|
13473
13943
|
const children = [];
|
|
13474
13944
|
if (this._sxVersion) children.push(this._sxVersion);
|
|
@@ -13512,11 +13982,13 @@ var Footprint = class _Footprint extends SxClass {
|
|
|
13512
13982
|
children.push(...this._fpRects);
|
|
13513
13983
|
children.push(...this._fpCircles);
|
|
13514
13984
|
children.push(...this._fpArcs);
|
|
13985
|
+
children.push(...this._fpCurves);
|
|
13515
13986
|
children.push(...this._fpPolys);
|
|
13516
13987
|
children.push(...this._points);
|
|
13517
13988
|
children.push(...this._fpPads);
|
|
13518
13989
|
children.push(...this._models);
|
|
13519
13990
|
children.push(...this._zones);
|
|
13991
|
+
children.push(...this._groups);
|
|
13520
13992
|
return children;
|
|
13521
13993
|
}
|
|
13522
13994
|
getString() {
|
|
@@ -13562,7 +14034,7 @@ var GrArcLocked = class _GrArcLocked extends SxPrimitiveBoolean {
|
|
|
13562
14034
|
SxClass.register(GrArcLocked);
|
|
13563
14035
|
|
|
13564
14036
|
// lib/sexpr/classes/GrArc.ts
|
|
13565
|
-
var
|
|
14037
|
+
var SUPPORTED_SINGLE_TOKENS7 = /* @__PURE__ */ new Set([
|
|
13566
14038
|
"start",
|
|
13567
14039
|
"mid",
|
|
13568
14040
|
"end",
|
|
@@ -13602,12 +14074,12 @@ var GrArc = class _GrArc extends SxClass {
|
|
|
13602
14074
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
13603
14075
|
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
13604
14076
|
for (const token of Object.keys(propertyMap)) {
|
|
13605
|
-
if (!
|
|
14077
|
+
if (!SUPPORTED_SINGLE_TOKENS7.has(token)) {
|
|
13606
14078
|
unexpectedTokens.add(token);
|
|
13607
14079
|
}
|
|
13608
14080
|
}
|
|
13609
14081
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
13610
|
-
if (!
|
|
14082
|
+
if (!SUPPORTED_SINGLE_TOKENS7.has(token)) {
|
|
13611
14083
|
unexpectedTokens.add(token);
|
|
13612
14084
|
continue;
|
|
13613
14085
|
}
|
|
@@ -13879,7 +14351,7 @@ var GrArcEnd = class _GrArcEnd extends SxClass {
|
|
|
13879
14351
|
SxClass.register(GrArcEnd);
|
|
13880
14352
|
|
|
13881
14353
|
// lib/sexpr/classes/GrCircle.ts
|
|
13882
|
-
var
|
|
14354
|
+
var SUPPORTED_SINGLE_TOKENS8 = /* @__PURE__ */ new Set([
|
|
13883
14355
|
"center",
|
|
13884
14356
|
"end",
|
|
13885
14357
|
"layer",
|
|
@@ -13919,12 +14391,12 @@ var GrCircle = class _GrCircle extends SxClass {
|
|
|
13919
14391
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
13920
14392
|
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
13921
14393
|
for (const token of Object.keys(propertyMap)) {
|
|
13922
|
-
if (!
|
|
14394
|
+
if (!SUPPORTED_SINGLE_TOKENS8.has(token)) {
|
|
13923
14395
|
unexpectedTokens.add(token);
|
|
13924
14396
|
}
|
|
13925
14397
|
}
|
|
13926
14398
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
13927
|
-
if (!
|
|
14399
|
+
if (!SUPPORTED_SINGLE_TOKENS8.has(token)) {
|
|
13928
14400
|
unexpectedTokens.add(token);
|
|
13929
14401
|
continue;
|
|
13930
14402
|
}
|
|
@@ -14189,7 +14661,7 @@ var GrCircleLocked = class _GrCircleLocked extends SxClass {
|
|
|
14189
14661
|
SxClass.register(GrCircleLocked);
|
|
14190
14662
|
|
|
14191
14663
|
// lib/sexpr/classes/GrCurve.ts
|
|
14192
|
-
var
|
|
14664
|
+
var SUPPORTED_TOKENS18 = /* @__PURE__ */ new Set([
|
|
14193
14665
|
"pts",
|
|
14194
14666
|
"xy",
|
|
14195
14667
|
"layer",
|
|
@@ -14221,12 +14693,12 @@ var GrCurve = class _GrCurve extends SxClass {
|
|
|
14221
14693
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
14222
14694
|
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
14223
14695
|
for (const token of Object.keys(propertyMap)) {
|
|
14224
|
-
if (!
|
|
14696
|
+
if (!SUPPORTED_TOKENS18.has(token)) {
|
|
14225
14697
|
unexpectedTokens.add(token);
|
|
14226
14698
|
}
|
|
14227
14699
|
}
|
|
14228
14700
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
14229
|
-
if (!
|
|
14701
|
+
if (!SUPPORTED_TOKENS18.has(token)) {
|
|
14230
14702
|
unexpectedTokens.add(token);
|
|
14231
14703
|
continue;
|
|
14232
14704
|
}
|
|
@@ -14419,7 +14891,7 @@ var GrLineLocked = class _GrLineLocked extends SxPrimitiveBoolean {
|
|
|
14419
14891
|
SxClass.register(GrLineLocked);
|
|
14420
14892
|
|
|
14421
14893
|
// lib/sexpr/classes/GrLine.ts
|
|
14422
|
-
var
|
|
14894
|
+
var SUPPORTED_SINGLE_TOKENS9 = /* @__PURE__ */ new Set([
|
|
14423
14895
|
"start",
|
|
14424
14896
|
"end",
|
|
14425
14897
|
"angle",
|
|
@@ -14459,12 +14931,12 @@ var GrLine = class _GrLine extends SxClass {
|
|
|
14459
14931
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
14460
14932
|
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
14461
14933
|
for (const token of Object.keys(propertyMap)) {
|
|
14462
|
-
if (!
|
|
14934
|
+
if (!SUPPORTED_SINGLE_TOKENS9.has(token)) {
|
|
14463
14935
|
unexpectedTokens.add(token);
|
|
14464
14936
|
}
|
|
14465
14937
|
}
|
|
14466
14938
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
14467
|
-
if (!
|
|
14939
|
+
if (!SUPPORTED_SINGLE_TOKENS9.has(token)) {
|
|
14468
14940
|
unexpectedTokens.add(token);
|
|
14469
14941
|
continue;
|
|
14470
14942
|
}
|
|
@@ -14632,7 +15104,7 @@ var GrLine = class _GrLine extends SxClass {
|
|
|
14632
15104
|
SxClass.register(GrLine);
|
|
14633
15105
|
|
|
14634
15106
|
// lib/sexpr/classes/GrRect.ts
|
|
14635
|
-
var
|
|
15107
|
+
var SUPPORTED_SINGLE_TOKENS10 = /* @__PURE__ */ new Set([
|
|
14636
15108
|
"start",
|
|
14637
15109
|
"end",
|
|
14638
15110
|
"layer",
|
|
@@ -14669,12 +15141,12 @@ var GrRect = class _GrRect extends SxClass {
|
|
|
14669
15141
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
14670
15142
|
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
14671
15143
|
for (const token of Object.keys(propertyMap)) {
|
|
14672
|
-
if (!
|
|
15144
|
+
if (!SUPPORTED_SINGLE_TOKENS10.has(token)) {
|
|
14673
15145
|
unexpectedTokens.add(token);
|
|
14674
15146
|
}
|
|
14675
15147
|
}
|
|
14676
15148
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
14677
|
-
if (!
|
|
15149
|
+
if (!SUPPORTED_SINGLE_TOKENS10.has(token)) {
|
|
14678
15150
|
unexpectedTokens.add(token);
|
|
14679
15151
|
continue;
|
|
14680
15152
|
}
|
|
@@ -14971,14 +15443,15 @@ var GrRectLocked = class _GrRectLocked extends SxClass {
|
|
|
14971
15443
|
SxClass.register(GrRectLocked);
|
|
14972
15444
|
|
|
14973
15445
|
// lib/sexpr/classes/GrText.ts
|
|
14974
|
-
var
|
|
15446
|
+
var SUPPORTED_SINGLE_TOKENS11 = /* @__PURE__ */ new Set([
|
|
14975
15447
|
"at",
|
|
14976
15448
|
"xy",
|
|
14977
15449
|
"layer",
|
|
14978
15450
|
"tstamp",
|
|
14979
15451
|
"uuid",
|
|
14980
15452
|
"effects",
|
|
14981
|
-
"render_cache"
|
|
15453
|
+
"render_cache",
|
|
15454
|
+
"locked"
|
|
14982
15455
|
]);
|
|
14983
15456
|
var SUPPORTED_ARRAY_TOKENS3 = /* @__PURE__ */ new Set([
|
|
14984
15457
|
"at",
|
|
@@ -14987,7 +15460,8 @@ var SUPPORTED_ARRAY_TOKENS3 = /* @__PURE__ */ new Set([
|
|
|
14987
15460
|
"tstamp",
|
|
14988
15461
|
"uuid",
|
|
14989
15462
|
"effects",
|
|
14990
|
-
"render_cache"
|
|
15463
|
+
"render_cache",
|
|
15464
|
+
"locked"
|
|
14991
15465
|
]);
|
|
14992
15466
|
var GrText = class _GrText extends SxClass {
|
|
14993
15467
|
static token = "gr_text";
|
|
@@ -14999,6 +15473,7 @@ var GrText = class _GrText extends SxClass {
|
|
|
14999
15473
|
_sxUuid;
|
|
15000
15474
|
_sxEffects;
|
|
15001
15475
|
_renderCaches = [];
|
|
15476
|
+
_locked = false;
|
|
15002
15477
|
constructor(params = {}) {
|
|
15003
15478
|
super();
|
|
15004
15479
|
if (typeof params === "string") {
|
|
@@ -15012,6 +15487,7 @@ var GrText = class _GrText extends SxClass {
|
|
|
15012
15487
|
if (params.effects !== void 0) this.effects = params.effects;
|
|
15013
15488
|
if (params.renderCaches !== void 0)
|
|
15014
15489
|
this.renderCaches = params.renderCaches;
|
|
15490
|
+
if (params.locked !== void 0) this.locked = params.locked;
|
|
15015
15491
|
}
|
|
15016
15492
|
}
|
|
15017
15493
|
static fromSexprPrimitives(primitiveSexprs) {
|
|
@@ -15024,10 +15500,21 @@ var GrText = class _GrText extends SxClass {
|
|
|
15024
15500
|
throw new Error("gr_text text must be a string value");
|
|
15025
15501
|
}
|
|
15026
15502
|
const grText = new _GrText(text);
|
|
15027
|
-
const
|
|
15503
|
+
const structuredRest = [];
|
|
15504
|
+
for (const primitive of rest) {
|
|
15505
|
+
if (primitive === "locked") {
|
|
15506
|
+
if (grText._locked) {
|
|
15507
|
+
throw new Error("gr_text encountered duplicate locked flags");
|
|
15508
|
+
}
|
|
15509
|
+
grText._locked = true;
|
|
15510
|
+
continue;
|
|
15511
|
+
}
|
|
15512
|
+
structuredRest.push(primitive);
|
|
15513
|
+
}
|
|
15514
|
+
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(structuredRest, this.token);
|
|
15028
15515
|
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
15029
15516
|
for (const token of Object.keys(propertyMap)) {
|
|
15030
|
-
if (!
|
|
15517
|
+
if (!SUPPORTED_SINGLE_TOKENS11.has(token)) {
|
|
15031
15518
|
unexpectedTokens.add(token);
|
|
15032
15519
|
}
|
|
15033
15520
|
}
|
|
@@ -15047,7 +15534,7 @@ var GrText = class _GrText extends SxClass {
|
|
|
15047
15534
|
`Unsupported child tokens inside gr_text expression: ${[...unexpectedTokens].join(", ")}`
|
|
15048
15535
|
);
|
|
15049
15536
|
}
|
|
15050
|
-
for (const primitive of
|
|
15537
|
+
for (const primitive of structuredRest) {
|
|
15051
15538
|
if (Array.isArray(primitive)) continue;
|
|
15052
15539
|
throw new Error(
|
|
15053
15540
|
`gr_text encountered unexpected primitive child: ${JSON.stringify(primitive)}`
|
|
@@ -15063,6 +15550,8 @@ var GrText = class _GrText extends SxClass {
|
|
|
15063
15550
|
grText._sxTstamp = propertyMap.tstamp;
|
|
15064
15551
|
grText._sxUuid = propertyMap.uuid;
|
|
15065
15552
|
grText._sxEffects = propertyMap.effects;
|
|
15553
|
+
const locked = propertyMap.locked;
|
|
15554
|
+
grText._locked = grText._locked || (locked?.value ?? false);
|
|
15066
15555
|
const renderCaches = arrayPropertyMap.render_cache;
|
|
15067
15556
|
if (renderCaches && renderCaches.length > 0) {
|
|
15068
15557
|
grText._renderCaches = renderCaches;
|
|
@@ -15157,6 +15646,12 @@ var GrText = class _GrText extends SxClass {
|
|
|
15157
15646
|
set renderCaches(value) {
|
|
15158
15647
|
this._renderCaches = [...value];
|
|
15159
15648
|
}
|
|
15649
|
+
get locked() {
|
|
15650
|
+
return this._locked;
|
|
15651
|
+
}
|
|
15652
|
+
set locked(value) {
|
|
15653
|
+
this._locked = value;
|
|
15654
|
+
}
|
|
15160
15655
|
getChildren() {
|
|
15161
15656
|
const children = [];
|
|
15162
15657
|
if (this._sxPosition) children.push(this._sxPosition);
|
|
@@ -15164,6 +15659,7 @@ var GrText = class _GrText extends SxClass {
|
|
|
15164
15659
|
if (this._sxTstamp) children.push(this._sxTstamp);
|
|
15165
15660
|
if (this._sxUuid) children.push(this._sxUuid);
|
|
15166
15661
|
if (this._sxEffects) children.push(this._sxEffects);
|
|
15662
|
+
if (this._locked) children.push(new GrTextLocked(true));
|
|
15167
15663
|
children.push(...this._renderCaches);
|
|
15168
15664
|
return children;
|
|
15169
15665
|
}
|
|
@@ -15177,6 +15673,27 @@ var GrText = class _GrText extends SxClass {
|
|
|
15177
15673
|
}
|
|
15178
15674
|
};
|
|
15179
15675
|
SxClass.register(GrText);
|
|
15676
|
+
var GrTextLocked = class _GrTextLocked extends SxClass {
|
|
15677
|
+
constructor(value = true) {
|
|
15678
|
+
super();
|
|
15679
|
+
this.value = value;
|
|
15680
|
+
}
|
|
15681
|
+
value;
|
|
15682
|
+
static token = "locked";
|
|
15683
|
+
static parentToken = "gr_text";
|
|
15684
|
+
token = "locked";
|
|
15685
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
15686
|
+
if (primitiveSexprs.length === 0) {
|
|
15687
|
+
return new _GrTextLocked(true);
|
|
15688
|
+
}
|
|
15689
|
+
const parsed = parseYesNo(primitiveSexprs[0]);
|
|
15690
|
+
return new _GrTextLocked(parsed ?? false);
|
|
15691
|
+
}
|
|
15692
|
+
getString() {
|
|
15693
|
+
return "(locked)";
|
|
15694
|
+
}
|
|
15695
|
+
};
|
|
15696
|
+
SxClass.register(GrTextLocked);
|
|
15180
15697
|
var GrTextRenderCache = class _GrTextRenderCache extends SxClass {
|
|
15181
15698
|
static token = "render_cache";
|
|
15182
15699
|
static parentToken = "gr_text";
|
|
@@ -15330,7 +15847,7 @@ var GrPolyFill = class _GrPolyFill extends SxClass {
|
|
|
15330
15847
|
}
|
|
15331
15848
|
};
|
|
15332
15849
|
SxClass.register(GrPolyFill);
|
|
15333
|
-
var
|
|
15850
|
+
var SUPPORTED_TOKENS19 = /* @__PURE__ */ new Set([
|
|
15334
15851
|
"pts",
|
|
15335
15852
|
"xy",
|
|
15336
15853
|
"layer",
|
|
@@ -15365,12 +15882,12 @@ var GrPoly = class _GrPoly extends SxClass {
|
|
|
15365
15882
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
15366
15883
|
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
15367
15884
|
for (const token of Object.keys(propertyMap)) {
|
|
15368
|
-
if (!
|
|
15885
|
+
if (!SUPPORTED_TOKENS19.has(token)) {
|
|
15369
15886
|
unexpectedTokens.add(token);
|
|
15370
15887
|
}
|
|
15371
15888
|
}
|
|
15372
15889
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
15373
|
-
if (!
|
|
15890
|
+
if (!SUPPORTED_TOKENS19.has(token)) {
|
|
15374
15891
|
unexpectedTokens.add(token);
|
|
15375
15892
|
}
|
|
15376
15893
|
if (token !== "xy" && arrayPropertyMap[token].length > 1) {
|
|
@@ -15416,7 +15933,7 @@ var GrPoly = class _GrPoly extends SxClass {
|
|
|
15416
15933
|
`gr_poly child token must be a string, received: ${JSON.stringify(token)}`
|
|
15417
15934
|
);
|
|
15418
15935
|
}
|
|
15419
|
-
if (!
|
|
15936
|
+
if (!SUPPORTED_TOKENS19.has(token)) {
|
|
15420
15937
|
throw new Error(
|
|
15421
15938
|
`Unsupported child token inside gr_poly expression: ${token}`
|
|
15422
15939
|
);
|
|
@@ -15607,7 +16124,7 @@ var DimensionFormatUnitsFormat = class extends SxPrimitiveNumber {
|
|
|
15607
16124
|
SxClass.register(DimensionFormatUnitsFormat);
|
|
15608
16125
|
|
|
15609
16126
|
// lib/sexpr/classes/DimensionFormat.ts
|
|
15610
|
-
var
|
|
16127
|
+
var SUPPORTED_TOKENS20 = /* @__PURE__ */ new Set([
|
|
15611
16128
|
"prefix",
|
|
15612
16129
|
"suffix",
|
|
15613
16130
|
"units",
|
|
@@ -15631,7 +16148,7 @@ var DimensionFormat = class _DimensionFormat extends SxClass {
|
|
|
15631
16148
|
const format = new _DimensionFormat();
|
|
15632
16149
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
15633
16150
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
15634
|
-
if (!
|
|
16151
|
+
if (!SUPPORTED_TOKENS20.has(token)) {
|
|
15635
16152
|
throw new Error(`format does not support child token "${token}"`);
|
|
15636
16153
|
}
|
|
15637
16154
|
if (arrayPropertyMap[token].length > 1) {
|
|
@@ -15791,7 +16308,7 @@ var DimensionTextPositionMode = class extends SxPrimitiveNumber {
|
|
|
15791
16308
|
SxClass.register(DimensionTextPositionMode);
|
|
15792
16309
|
|
|
15793
16310
|
// lib/sexpr/classes/DimensionStyle.ts
|
|
15794
|
-
var
|
|
16311
|
+
var SUPPORTED_TOKENS21 = /* @__PURE__ */ new Set([
|
|
15795
16312
|
"thickness",
|
|
15796
16313
|
"arrow_length",
|
|
15797
16314
|
"text_position_mode",
|
|
@@ -15817,7 +16334,7 @@ var DimensionStyle = class _DimensionStyle extends SxClass {
|
|
|
15817
16334
|
const style = new _DimensionStyle();
|
|
15818
16335
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
15819
16336
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
15820
|
-
if (!
|
|
16337
|
+
if (!SUPPORTED_TOKENS21.has(token)) {
|
|
15821
16338
|
throw new Error(`style does not support child token "${token}"`);
|
|
15822
16339
|
}
|
|
15823
16340
|
if (arrayPropertyMap[token].length > 1) {
|
|
@@ -15826,8 +16343,13 @@ var DimensionStyle = class _DimensionStyle extends SxClass {
|
|
|
15826
16343
|
);
|
|
15827
16344
|
}
|
|
15828
16345
|
}
|
|
16346
|
+
let hasBareKeepTextAligned = false;
|
|
15829
16347
|
for (const primitive of primitiveSexprs) {
|
|
15830
16348
|
if (!Array.isArray(primitive)) {
|
|
16349
|
+
if (primitive === "keep_text_aligned") {
|
|
16350
|
+
hasBareKeepTextAligned = true;
|
|
16351
|
+
continue;
|
|
16352
|
+
}
|
|
15831
16353
|
throw new Error(
|
|
15832
16354
|
`style encountered unexpected primitive child ${JSON.stringify(primitive)}`
|
|
15833
16355
|
);
|
|
@@ -15841,6 +16363,9 @@ var DimensionStyle = class _DimensionStyle extends SxClass {
|
|
|
15841
16363
|
style._sxTextFrame = propertyMap.text_frame;
|
|
15842
16364
|
style._sxExtensionOffset = propertyMap.extension_offset;
|
|
15843
16365
|
style._sxKeepTextAligned = propertyMap.keep_text_aligned;
|
|
16366
|
+
if (hasBareKeepTextAligned) {
|
|
16367
|
+
style._sxKeepTextAligned = new DimensionKeepTextAligned(true);
|
|
16368
|
+
}
|
|
15844
16369
|
if (!style._sxThickness) {
|
|
15845
16370
|
throw new Error("style requires a thickness child token");
|
|
15846
16371
|
}
|
|
@@ -15876,7 +16401,7 @@ var DimensionType = class extends SxPrimitiveString {
|
|
|
15876
16401
|
SxClass.register(DimensionType);
|
|
15877
16402
|
|
|
15878
16403
|
// lib/sexpr/classes/Dimension.ts
|
|
15879
|
-
var
|
|
16404
|
+
var SUPPORTED_TOKENS22 = /* @__PURE__ */ new Set([
|
|
15880
16405
|
"locked",
|
|
15881
16406
|
"type",
|
|
15882
16407
|
"layer",
|
|
@@ -15908,7 +16433,7 @@ var Dimension = class _Dimension extends SxClass {
|
|
|
15908
16433
|
const dimension = new _Dimension();
|
|
15909
16434
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
15910
16435
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
15911
|
-
if (!
|
|
16436
|
+
if (!SUPPORTED_TOKENS22.has(token)) {
|
|
15912
16437
|
throw new Error(`dimension does not support child token "${token}"`);
|
|
15913
16438
|
}
|
|
15914
16439
|
if (arrayPropertyMap[token].length > 1) {
|
|
@@ -15979,7 +16504,7 @@ var TargetSize = class extends SxPrimitiveNumber {
|
|
|
15979
16504
|
SxClass.register(TargetSize);
|
|
15980
16505
|
|
|
15981
16506
|
// lib/sexpr/classes/Target.ts
|
|
15982
|
-
var
|
|
16507
|
+
var SUPPORTED_TOKENS23 = /* @__PURE__ */ new Set(["at", "size", "width", "layer", "uuid"]);
|
|
15983
16508
|
var Target = class _Target extends SxClass {
|
|
15984
16509
|
static token = "target";
|
|
15985
16510
|
static parentToken = "kicad_pcb";
|
|
@@ -16002,7 +16527,7 @@ var Target = class _Target extends SxClass {
|
|
|
16002
16527
|
const target = new _Target(rawShape);
|
|
16003
16528
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(rest, this.token);
|
|
16004
16529
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
16005
|
-
if (!
|
|
16530
|
+
if (!SUPPORTED_TOKENS23.has(token)) {
|
|
16006
16531
|
throw new Error(`target does not support child token "${token}"`);
|
|
16007
16532
|
}
|
|
16008
16533
|
if (arrayPropertyMap[token].length > 1) {
|
|
@@ -16064,170 +16589,6 @@ var Target = class _Target extends SxClass {
|
|
|
16064
16589
|
};
|
|
16065
16590
|
SxClass.register(Target);
|
|
16066
16591
|
|
|
16067
|
-
// lib/sexpr/classes/Group.ts
|
|
16068
|
-
var SUPPORTED_SINGLE_TOKENS11 = /* @__PURE__ */ new Set(["uuid", "locked", "members"]);
|
|
16069
|
-
var Group = class _Group extends SxClass {
|
|
16070
|
-
static token = "group";
|
|
16071
|
-
token = "group";
|
|
16072
|
-
_name = "";
|
|
16073
|
-
_sxUuid;
|
|
16074
|
-
_sxLocked;
|
|
16075
|
-
_sxMembers;
|
|
16076
|
-
constructor(params = {}) {
|
|
16077
|
-
super();
|
|
16078
|
-
if (params.name !== void 0) this.name = params.name;
|
|
16079
|
-
if (params.uuid !== void 0) this.uuid = params.uuid;
|
|
16080
|
-
if (params.locked !== void 0) this.locked = params.locked;
|
|
16081
|
-
if (params.members !== void 0) this.members = params.members;
|
|
16082
|
-
}
|
|
16083
|
-
static fromSexprPrimitives(primitiveSexprs) {
|
|
16084
|
-
const group = new _Group();
|
|
16085
|
-
if (primitiveSexprs.length > 0 && typeof primitiveSexprs[0] === "string") {
|
|
16086
|
-
group._name = primitiveSexprs[0];
|
|
16087
|
-
}
|
|
16088
|
-
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(
|
|
16089
|
-
primitiveSexprs.slice(1),
|
|
16090
|
-
this.token
|
|
16091
|
-
);
|
|
16092
|
-
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
16093
|
-
for (const token of Object.keys(propertyMap)) {
|
|
16094
|
-
if (!SUPPORTED_SINGLE_TOKENS11.has(token)) {
|
|
16095
|
-
unexpectedTokens.add(token);
|
|
16096
|
-
}
|
|
16097
|
-
}
|
|
16098
|
-
for (const token of Object.keys(arrayPropertyMap)) {
|
|
16099
|
-
if (!SUPPORTED_SINGLE_TOKENS11.has(token)) {
|
|
16100
|
-
unexpectedTokens.add(token);
|
|
16101
|
-
continue;
|
|
16102
|
-
}
|
|
16103
|
-
if (arrayPropertyMap[token].length > 1) {
|
|
16104
|
-
throw new Error(
|
|
16105
|
-
`group does not support repeated child tokens: ${token}`
|
|
16106
|
-
);
|
|
16107
|
-
}
|
|
16108
|
-
}
|
|
16109
|
-
if (unexpectedTokens.size > 0) {
|
|
16110
|
-
throw new Error(
|
|
16111
|
-
`Unsupported child tokens inside group expression: ${[...unexpectedTokens].join(", ")}`
|
|
16112
|
-
);
|
|
16113
|
-
}
|
|
16114
|
-
for (const primitive of primitiveSexprs.slice(1)) {
|
|
16115
|
-
if (Array.isArray(primitive)) continue;
|
|
16116
|
-
throw new Error(
|
|
16117
|
-
`group encountered unexpected primitive child: ${JSON.stringify(primitive)}`
|
|
16118
|
-
);
|
|
16119
|
-
}
|
|
16120
|
-
group._sxUuid = propertyMap.uuid;
|
|
16121
|
-
const locked = propertyMap.locked;
|
|
16122
|
-
group._sxLocked = locked && locked.value ? locked : void 0;
|
|
16123
|
-
group._sxMembers = propertyMap.members;
|
|
16124
|
-
return group;
|
|
16125
|
-
}
|
|
16126
|
-
get name() {
|
|
16127
|
-
return this._name;
|
|
16128
|
-
}
|
|
16129
|
-
set name(value) {
|
|
16130
|
-
this._name = value;
|
|
16131
|
-
}
|
|
16132
|
-
get uuid() {
|
|
16133
|
-
return this._sxUuid?.value;
|
|
16134
|
-
}
|
|
16135
|
-
set uuid(value) {
|
|
16136
|
-
if (value === void 0) {
|
|
16137
|
-
this._sxUuid = void 0;
|
|
16138
|
-
return;
|
|
16139
|
-
}
|
|
16140
|
-
this._sxUuid = value instanceof Uuid ? value : new Uuid(value);
|
|
16141
|
-
}
|
|
16142
|
-
get uuidClass() {
|
|
16143
|
-
return this._sxUuid;
|
|
16144
|
-
}
|
|
16145
|
-
get locked() {
|
|
16146
|
-
return this._sxLocked?.value ?? false;
|
|
16147
|
-
}
|
|
16148
|
-
set locked(value) {
|
|
16149
|
-
this._sxLocked = value ? new GroupLocked(true) : void 0;
|
|
16150
|
-
}
|
|
16151
|
-
get members() {
|
|
16152
|
-
return this._sxMembers?.members ?? [];
|
|
16153
|
-
}
|
|
16154
|
-
set members(value) {
|
|
16155
|
-
this._sxMembers = new GroupMembers(value);
|
|
16156
|
-
}
|
|
16157
|
-
get membersClass() {
|
|
16158
|
-
return this._sxMembers;
|
|
16159
|
-
}
|
|
16160
|
-
getChildren() {
|
|
16161
|
-
const children = [];
|
|
16162
|
-
if (this._sxUuid) children.push(this._sxUuid);
|
|
16163
|
-
if (this._sxLocked) children.push(this._sxLocked);
|
|
16164
|
-
if (this._sxMembers) children.push(this._sxMembers);
|
|
16165
|
-
return children;
|
|
16166
|
-
}
|
|
16167
|
-
getString() {
|
|
16168
|
-
const lines = [`(group "${this._name}"`];
|
|
16169
|
-
const push = (value) => {
|
|
16170
|
-
if (!value) return;
|
|
16171
|
-
lines.push(value.getStringIndented());
|
|
16172
|
-
};
|
|
16173
|
-
push(this._sxUuid);
|
|
16174
|
-
push(this._sxLocked);
|
|
16175
|
-
push(this._sxMembers);
|
|
16176
|
-
lines.push(")");
|
|
16177
|
-
return lines.join("\n");
|
|
16178
|
-
}
|
|
16179
|
-
};
|
|
16180
|
-
SxClass.register(Group);
|
|
16181
|
-
var GroupLocked = class _GroupLocked extends SxClass {
|
|
16182
|
-
static token = "locked";
|
|
16183
|
-
static parentToken = "group";
|
|
16184
|
-
token = "locked";
|
|
16185
|
-
value;
|
|
16186
|
-
constructor(value) {
|
|
16187
|
-
super();
|
|
16188
|
-
this.value = value;
|
|
16189
|
-
}
|
|
16190
|
-
static fromSexprPrimitives(primitiveSexprs) {
|
|
16191
|
-
if (primitiveSexprs.length === 0) {
|
|
16192
|
-
return new _GroupLocked(true);
|
|
16193
|
-
}
|
|
16194
|
-
const state = toStringValue(primitiveSexprs[0]);
|
|
16195
|
-
return new _GroupLocked(state === "yes");
|
|
16196
|
-
}
|
|
16197
|
-
getString() {
|
|
16198
|
-
return this.value ? "(locked yes)" : "(locked no)";
|
|
16199
|
-
}
|
|
16200
|
-
};
|
|
16201
|
-
SxClass.register(GroupLocked);
|
|
16202
|
-
var GroupMembers = class _GroupMembers extends SxClass {
|
|
16203
|
-
static token = "members";
|
|
16204
|
-
static parentToken = "group";
|
|
16205
|
-
token = "members";
|
|
16206
|
-
members;
|
|
16207
|
-
constructor(members) {
|
|
16208
|
-
super();
|
|
16209
|
-
this.members = members;
|
|
16210
|
-
}
|
|
16211
|
-
static fromSexprPrimitives(primitiveSexprs) {
|
|
16212
|
-
const members = [];
|
|
16213
|
-
for (const primitive of primitiveSexprs) {
|
|
16214
|
-
const str = toStringValue(primitive);
|
|
16215
|
-
if (str) {
|
|
16216
|
-
members.push(str);
|
|
16217
|
-
}
|
|
16218
|
-
}
|
|
16219
|
-
return new _GroupMembers(members);
|
|
16220
|
-
}
|
|
16221
|
-
getString() {
|
|
16222
|
-
if (this.members.length === 0) {
|
|
16223
|
-
return "(members)";
|
|
16224
|
-
}
|
|
16225
|
-
const memberStrings = this.members.map((m) => `"${m}"`).join(" ");
|
|
16226
|
-
return `(members ${memberStrings})`;
|
|
16227
|
-
}
|
|
16228
|
-
};
|
|
16229
|
-
SxClass.register(GroupMembers);
|
|
16230
|
-
|
|
16231
16592
|
// lib/sexpr/classes/Generated.ts
|
|
16232
16593
|
var Generated = class _Generated extends SxClass {
|
|
16233
16594
|
static token = "generated";
|
|
@@ -20091,6 +20452,7 @@ export {
|
|
|
20091
20452
|
FootprintSheetname,
|
|
20092
20453
|
FootprintSolderMaskMargin,
|
|
20093
20454
|
FootprintSolderPasteMargin,
|
|
20455
|
+
FootprintSolderPasteMarginRatio,
|
|
20094
20456
|
FootprintSolderPasteRatio,
|
|
20095
20457
|
FootprintTags,
|
|
20096
20458
|
FootprintTedit,
|
|
@@ -20111,6 +20473,8 @@ export {
|
|
|
20111
20473
|
FpCircleEnd,
|
|
20112
20474
|
FpCircleFill,
|
|
20113
20475
|
FpCircleNet,
|
|
20476
|
+
FpCurve,
|
|
20477
|
+
FpCurveLocked,
|
|
20114
20478
|
FpLine,
|
|
20115
20479
|
FpLineEnd,
|
|
20116
20480
|
FpLineNet,
|
|
@@ -20155,6 +20519,7 @@ export {
|
|
|
20155
20519
|
GrRectLocked,
|
|
20156
20520
|
GrRectStart,
|
|
20157
20521
|
GrText,
|
|
20522
|
+
GrTextLocked,
|
|
20158
20523
|
GrTextRenderCache,
|
|
20159
20524
|
GrTextRenderCachePolygon,
|
|
20160
20525
|
Group,
|
|
@@ -20444,6 +20809,7 @@ export {
|
|
|
20444
20809
|
ZoneFillThermalGap,
|
|
20445
20810
|
ZoneFilledAreasThickness,
|
|
20446
20811
|
ZoneFilledPolygon,
|
|
20812
|
+
ZoneFilledPolygonIsland,
|
|
20447
20813
|
ZoneHatch,
|
|
20448
20814
|
ZoneKeepout,
|
|
20449
20815
|
ZoneKeepoutCopperpour,
|