@tscircuit/core 0.0.1045 → 0.0.1047
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 +34 -28
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9428,7 +9428,10 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
9428
9428
|
metadata: props.kicadFootprintMetadata ? { kicad_footprint: props.kicadFootprintMetadata } : void 0
|
|
9429
9429
|
});
|
|
9430
9430
|
const footprint = props.footprint ?? this._getImpliedFootprintString();
|
|
9431
|
-
|
|
9431
|
+
const hasFootprintChild = this.children.some(
|
|
9432
|
+
(c) => c.componentName === "Footprint"
|
|
9433
|
+
);
|
|
9434
|
+
if (!footprint && !hasFootprintChild && !this.isGroup) {
|
|
9432
9435
|
const footprint_error = db.pcb_missing_footprint_error.insert({
|
|
9433
9436
|
message: `No footprint found for component: ${this.getString()}`,
|
|
9434
9437
|
source_component_id: `${this.source_component_id}`,
|
|
@@ -16208,16 +16211,19 @@ var extractPcbPrimitivesFromCircuitJson = ({
|
|
|
16208
16211
|
return components;
|
|
16209
16212
|
};
|
|
16210
16213
|
|
|
16211
|
-
// lib/components/primitive-components/Group/Subcircuit/inflators/
|
|
16212
|
-
var
|
|
16214
|
+
// lib/components/primitive-components/Group/Subcircuit/inflators/inflateFootprintComponent.ts
|
|
16215
|
+
var inflateFootprintComponent = (pcbElm, inflatorContext) => {
|
|
16213
16216
|
const { injectionDb, normalComponent } = inflatorContext;
|
|
16214
|
-
if (!normalComponent) return;
|
|
16215
|
-
const
|
|
16217
|
+
if (!normalComponent) return null;
|
|
16218
|
+
const primitives = extractPcbPrimitivesFromCircuitJson({
|
|
16216
16219
|
pcbComponent: pcbElm,
|
|
16217
16220
|
db: injectionDb,
|
|
16218
16221
|
componentName: normalComponent.name
|
|
16219
16222
|
});
|
|
16220
|
-
|
|
16223
|
+
if (primitives.length === 0) return null;
|
|
16224
|
+
const footprint = new Footprint({});
|
|
16225
|
+
footprint.addAll(primitives);
|
|
16226
|
+
return footprint;
|
|
16221
16227
|
};
|
|
16222
16228
|
|
|
16223
16229
|
// lib/components/primitive-components/Group/Subcircuit/inflators/inflateSourceCapacitor.ts
|
|
@@ -16240,10 +16246,13 @@ function inflateSourceCapacitor(sourceElm, inflatorContext) {
|
|
|
16240
16246
|
obstructsWithinBounds: pcbElm?.obstructs_within_bounds
|
|
16241
16247
|
});
|
|
16242
16248
|
if (pcbElm) {
|
|
16243
|
-
|
|
16249
|
+
const footprint = inflateFootprintComponent(pcbElm, {
|
|
16244
16250
|
...inflatorContext,
|
|
16245
16251
|
normalComponent: capacitor
|
|
16246
16252
|
});
|
|
16253
|
+
if (footprint) {
|
|
16254
|
+
capacitor.add(footprint);
|
|
16255
|
+
}
|
|
16247
16256
|
}
|
|
16248
16257
|
if (sourceElm.source_group_id && groupsMap?.has(sourceElm.source_group_id)) {
|
|
16249
16258
|
const group = groupsMap.get(sourceElm.source_group_id);
|
|
@@ -16418,21 +16427,6 @@ var Chip = class extends NormalComponent3 {
|
|
|
16418
16427
|
}
|
|
16419
16428
|
};
|
|
16420
16429
|
|
|
16421
|
-
// lib/components/primitive-components/Group/Subcircuit/inflators/inflateFootprintComponent.ts
|
|
16422
|
-
var inflateFootprintComponent = (pcbElm, inflatorContext) => {
|
|
16423
|
-
const { injectionDb, normalComponent } = inflatorContext;
|
|
16424
|
-
if (!normalComponent) return null;
|
|
16425
|
-
const primitives = extractPcbPrimitivesFromCircuitJson({
|
|
16426
|
-
pcbComponent: pcbElm,
|
|
16427
|
-
db: injectionDb,
|
|
16428
|
-
componentName: normalComponent.name
|
|
16429
|
-
});
|
|
16430
|
-
if (primitives.length === 0) return null;
|
|
16431
|
-
const footprint = new Footprint({});
|
|
16432
|
-
footprint.addAll(primitives);
|
|
16433
|
-
return footprint;
|
|
16434
|
-
};
|
|
16435
|
-
|
|
16436
16430
|
// lib/components/primitive-components/Group/Subcircuit/inflators/inflateSourceChip.ts
|
|
16437
16431
|
var mapInternallyConnectedSourcePortIdsToPinLabels = (sourcePortIds, inflatorContext) => {
|
|
16438
16432
|
if (!sourcePortIds || sourcePortIds.length === 0) return void 0;
|
|
@@ -16572,10 +16566,13 @@ function inflateSourceDiode(sourceElm, inflatorContext) {
|
|
|
16572
16566
|
obstructsWithinBounds: pcbElm?.obstructs_within_bounds
|
|
16573
16567
|
});
|
|
16574
16568
|
if (pcbElm) {
|
|
16575
|
-
|
|
16569
|
+
const footprint = inflateFootprintComponent(pcbElm, {
|
|
16576
16570
|
...inflatorContext,
|
|
16577
16571
|
normalComponent: diode
|
|
16578
16572
|
});
|
|
16573
|
+
if (footprint) {
|
|
16574
|
+
diode.add(footprint);
|
|
16575
|
+
}
|
|
16579
16576
|
}
|
|
16580
16577
|
if (sourceElm.source_group_id && groupsMap?.has(sourceElm.source_group_id)) {
|
|
16581
16578
|
const group = groupsMap.get(sourceElm.source_group_id);
|
|
@@ -16664,10 +16661,13 @@ function inflateSourceInductor(sourceElm, inflatorContext) {
|
|
|
16664
16661
|
obstructsWithinBounds: pcbElm?.obstructs_within_bounds
|
|
16665
16662
|
});
|
|
16666
16663
|
if (pcbElm) {
|
|
16667
|
-
|
|
16664
|
+
const footprint = inflateFootprintComponent(pcbElm, {
|
|
16668
16665
|
...inflatorContext,
|
|
16669
16666
|
normalComponent: inductor
|
|
16670
16667
|
});
|
|
16668
|
+
if (footprint) {
|
|
16669
|
+
inductor.add(footprint);
|
|
16670
|
+
}
|
|
16671
16671
|
}
|
|
16672
16672
|
if (sourceElm.source_group_id && groupsMap?.has(sourceElm.source_group_id)) {
|
|
16673
16673
|
const group = groupsMap.get(sourceElm.source_group_id);
|
|
@@ -16811,10 +16811,13 @@ function inflateSourceResistor(sourceElm, inflatorContext) {
|
|
|
16811
16811
|
obstructsWithinBounds: pcbElm?.obstructs_within_bounds
|
|
16812
16812
|
});
|
|
16813
16813
|
if (pcbElm) {
|
|
16814
|
-
|
|
16814
|
+
const footprint = inflateFootprintComponent(pcbElm, {
|
|
16815
16815
|
...inflatorContext,
|
|
16816
16816
|
normalComponent: resistor
|
|
16817
16817
|
});
|
|
16818
|
+
if (footprint) {
|
|
16819
|
+
resistor.add(footprint);
|
|
16820
|
+
}
|
|
16818
16821
|
}
|
|
16819
16822
|
if (sourceElm.source_group_id && groupsMap?.has(sourceElm.source_group_id)) {
|
|
16820
16823
|
const group = groupsMap.get(sourceElm.source_group_id);
|
|
@@ -16989,10 +16992,13 @@ function inflateSourceTransistor(sourceElm, inflatorContext) {
|
|
|
16989
16992
|
obstructsWithinBounds: pcbElm?.obstructs_within_bounds
|
|
16990
16993
|
});
|
|
16991
16994
|
if (pcbElm) {
|
|
16992
|
-
|
|
16995
|
+
const footprint = inflateFootprintComponent(pcbElm, {
|
|
16993
16996
|
...inflatorContext,
|
|
16994
16997
|
normalComponent: transistor
|
|
16995
16998
|
});
|
|
16999
|
+
if (footprint) {
|
|
17000
|
+
transistor.add(footprint);
|
|
17001
|
+
}
|
|
16996
17002
|
}
|
|
16997
17003
|
if (sourceElm.source_group_id && groupsMap?.has(sourceElm.source_group_id)) {
|
|
16998
17004
|
const group = groupsMap.get(sourceElm.source_group_id);
|
|
@@ -17549,7 +17555,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
17549
17555
|
var package_default = {
|
|
17550
17556
|
name: "@tscircuit/core",
|
|
17551
17557
|
type: "module",
|
|
17552
|
-
version: "0.0.
|
|
17558
|
+
version: "0.0.1046",
|
|
17553
17559
|
types: "dist/index.d.ts",
|
|
17554
17560
|
main: "dist/index.js",
|
|
17555
17561
|
module: "dist/index.js",
|
|
@@ -17610,7 +17616,7 @@ var package_default = {
|
|
|
17610
17616
|
"circuit-json": "^0.0.383",
|
|
17611
17617
|
"circuit-json-to-bpc": "^0.0.13",
|
|
17612
17618
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
17613
|
-
"circuit-json-to-gltf": "^0.0.
|
|
17619
|
+
"circuit-json-to-gltf": "^0.0.70",
|
|
17614
17620
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
17615
17621
|
"circuit-json-to-spice": "^0.0.34",
|
|
17616
17622
|
"circuit-to-svg": "^0.0.328",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.1047",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"circuit-json": "^0.0.383",
|
|
63
63
|
"circuit-json-to-bpc": "^0.0.13",
|
|
64
64
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
65
|
-
"circuit-json-to-gltf": "^0.0.
|
|
65
|
+
"circuit-json-to-gltf": "^0.0.70",
|
|
66
66
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
67
67
|
"circuit-json-to-spice": "^0.0.34",
|
|
68
68
|
"circuit-to-svg": "^0.0.328",
|