@tscircuit/core 0.0.539 → 0.0.541
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 +5 -0
- package/dist/index.js +19 -47
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1545,6 +1545,7 @@ declare class Board extends Group<typeof boardProps> {
|
|
|
1545
1545
|
serverMode: zod.ZodOptional<zod.ZodEnum<["job", "solve-endpoint"]>>;
|
|
1546
1546
|
serverCacheEnabled: zod.ZodOptional<zod.ZodBoolean>;
|
|
1547
1547
|
cache: zod.ZodOptional<zod.ZodType<_tscircuit_props.PcbRouteCache, zod.ZodTypeDef, _tscircuit_props.PcbRouteCache>>;
|
|
1548
|
+
traceClearance: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
1548
1549
|
groupMode: zod.ZodOptional<zod.ZodEnum<["sequential-trace", "subcircuit"]>>;
|
|
1549
1550
|
algorithmFn: zod.ZodOptional<zod.ZodType<(simpleRouteJson: any) => Promise<any>, zod.ZodTypeDef, (simpleRouteJson: any) => Promise<any>>>;
|
|
1550
1551
|
local: zod.ZodOptional<zod.ZodBoolean>;
|
|
@@ -1554,6 +1555,7 @@ declare class Board extends Group<typeof boardProps> {
|
|
|
1554
1555
|
serverMode?: "job" | "solve-endpoint" | undefined;
|
|
1555
1556
|
serverCacheEnabled?: boolean | undefined;
|
|
1556
1557
|
cache?: _tscircuit_props.PcbRouteCache | undefined;
|
|
1558
|
+
traceClearance?: number | undefined;
|
|
1557
1559
|
groupMode?: "sequential-trace" | "subcircuit" | undefined;
|
|
1558
1560
|
algorithmFn?: ((simpleRouteJson: any) => Promise<any>) | undefined;
|
|
1559
1561
|
local?: boolean | undefined;
|
|
@@ -1563,6 +1565,7 @@ declare class Board extends Group<typeof boardProps> {
|
|
|
1563
1565
|
serverMode?: "job" | "solve-endpoint" | undefined;
|
|
1564
1566
|
serverCacheEnabled?: boolean | undefined;
|
|
1565
1567
|
cache?: _tscircuit_props.PcbRouteCache | undefined;
|
|
1568
|
+
traceClearance?: string | number | undefined;
|
|
1566
1569
|
groupMode?: "sequential-trace" | "subcircuit" | undefined;
|
|
1567
1570
|
algorithmFn?: ((simpleRouteJson: any) => Promise<any>) | undefined;
|
|
1568
1571
|
local?: boolean | undefined;
|
|
@@ -1740,6 +1743,7 @@ declare class Board extends Group<typeof boardProps> {
|
|
|
1740
1743
|
serverMode?: "job" | "solve-endpoint" | undefined;
|
|
1741
1744
|
serverCacheEnabled?: boolean | undefined;
|
|
1742
1745
|
cache?: _tscircuit_props.PcbRouteCache | undefined;
|
|
1746
|
+
traceClearance?: number | undefined;
|
|
1743
1747
|
groupMode?: "sequential-trace" | "subcircuit" | undefined;
|
|
1744
1748
|
algorithmFn?: ((simpleRouteJson: any) => Promise<any>) | undefined;
|
|
1745
1749
|
local?: boolean | undefined;
|
|
@@ -1913,6 +1917,7 @@ declare class Board extends Group<typeof boardProps> {
|
|
|
1913
1917
|
serverMode?: "job" | "solve-endpoint" | undefined;
|
|
1914
1918
|
serverCacheEnabled?: boolean | undefined;
|
|
1915
1919
|
cache?: _tscircuit_props.PcbRouteCache | undefined;
|
|
1920
|
+
traceClearance?: string | number | undefined;
|
|
1916
1921
|
groupMode?: "sequential-trace" | "subcircuit" | undefined;
|
|
1917
1922
|
algorithmFn?: ((simpleRouteJson: any) => Promise<any>) | undefined;
|
|
1918
1923
|
local?: boolean | undefined;
|
package/dist/index.js
CHANGED
|
@@ -7272,12 +7272,10 @@ import {
|
|
|
7272
7272
|
// lib/components/primitive-components/Group/Group_doInitialSchematicLayoutMatchAdapt.ts
|
|
7273
7273
|
import "@tscircuit/circuit-json-util";
|
|
7274
7274
|
import "circuit-json-to-connectivity-map";
|
|
7275
|
-
import corpus from "@tscircuit/schematic-corpus
|
|
7275
|
+
import corpus from "@tscircuit/schematic-corpus";
|
|
7276
7276
|
import { convertCircuitJsonToBpc } from "circuit-json-to-bpc";
|
|
7277
7277
|
import {
|
|
7278
|
-
|
|
7279
|
-
netAdaptBpcGraph,
|
|
7280
|
-
getBpcGraphWlDistance
|
|
7278
|
+
layoutSchematicGraph
|
|
7281
7279
|
} from "bpc-graph";
|
|
7282
7280
|
function Group_doInitialSchematicLayoutMatchAdapt(group) {
|
|
7283
7281
|
const { db } = group.root;
|
|
@@ -7327,40 +7325,13 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
|
|
|
7327
7325
|
subtreeCircuitJson.push(schematic_net_label);
|
|
7328
7326
|
}
|
|
7329
7327
|
const targetBpcGraph = convertCircuitJsonToBpc(subtreeCircuitJson);
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
box.center = void 0;
|
|
7334
|
-
}
|
|
7335
|
-
}
|
|
7336
|
-
let bestMatch = {
|
|
7337
|
-
boxes: [],
|
|
7338
|
-
pins: []
|
|
7339
|
-
};
|
|
7340
|
-
let bestWlDistance = Infinity;
|
|
7341
|
-
let winningBpcGraphName = "empty";
|
|
7342
|
-
for (const [candidateBpcGraphName, candidateBpcGraph] of Object.entries(
|
|
7328
|
+
const laidOutBpcGraph = layoutSchematicGraph(targetBpcGraph, {
|
|
7329
|
+
singletonKeys: ["vcc/2", "gnd/2"],
|
|
7330
|
+
centerPinColors: ["netlabel_center", "component_center"],
|
|
7343
7331
|
corpus
|
|
7344
|
-
)
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
targetBpcGraph
|
|
7348
|
-
);
|
|
7349
|
-
console.log(candidateBpcGraphName, wlDistance);
|
|
7350
|
-
if (wlDistance < bestWlDistance) {
|
|
7351
|
-
bestMatch = candidateBpcGraph;
|
|
7352
|
-
winningBpcGraphName = candidateBpcGraphName;
|
|
7353
|
-
bestWlDistance = wlDistance;
|
|
7354
|
-
if (wlDistance === 0) break;
|
|
7355
|
-
}
|
|
7356
|
-
}
|
|
7357
|
-
console.log(`Winning BPC graph: ${winningBpcGraphName}`);
|
|
7358
|
-
const { adaptedBpcGraph } = netAdaptBpcGraph(
|
|
7359
|
-
bestMatch,
|
|
7360
|
-
targetBpcGraph
|
|
7361
|
-
);
|
|
7362
|
-
const adaptedBpcGraphWithPositions = assignFloatingBoxPositions(adaptedBpcGraph);
|
|
7363
|
-
for (const box of adaptedBpcGraphWithPositions.boxes) {
|
|
7332
|
+
});
|
|
7333
|
+
for (const box of laidOutBpcGraph.boxes) {
|
|
7334
|
+
if (!box.center) continue;
|
|
7364
7335
|
const schematic_component2 = db.schematic_component.get(box.boxId);
|
|
7365
7336
|
if (schematic_component2) {
|
|
7366
7337
|
const ports = db.schematic_port.list({
|
|
@@ -7387,7 +7358,7 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
|
|
|
7387
7358
|
}
|
|
7388
7359
|
const schematic_net_label = db.schematic_net_label.get(box.boxId);
|
|
7389
7360
|
if (schematic_net_label) {
|
|
7390
|
-
const pin =
|
|
7361
|
+
const pin = laidOutBpcGraph.pins.find(
|
|
7391
7362
|
(p) => p.boxId === box.boxId && p.color === "netlabel_center"
|
|
7392
7363
|
);
|
|
7393
7364
|
if (!pin) {
|
|
@@ -7402,9 +7373,7 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
|
|
|
7402
7373
|
}
|
|
7403
7374
|
if (generatedNetLabels.has(box.boxId)) {
|
|
7404
7375
|
const { schematic_net_label: generatedNetLabel, schematic_port } = generatedNetLabels.get(box.boxId);
|
|
7405
|
-
const pins =
|
|
7406
|
-
(p) => p.boxId === box.boxId
|
|
7407
|
-
);
|
|
7376
|
+
const pins = laidOutBpcGraph.pins.filter((p) => p.boxId === box.boxId);
|
|
7408
7377
|
const center = pins.find((p) => p.color === "netlabel_center");
|
|
7409
7378
|
const anchor = pins.find((p) => p.color !== "netlabel_center");
|
|
7410
7379
|
const color = anchor.color;
|
|
@@ -7789,7 +7758,10 @@ var Group = class extends NormalComponent {
|
|
|
7789
7758
|
width: 0,
|
|
7790
7759
|
height: 0,
|
|
7791
7760
|
pcb_component_ids: [],
|
|
7792
|
-
source_group_id: this.source_group_id
|
|
7761
|
+
source_group_id: this.source_group_id,
|
|
7762
|
+
autorouter_configuration: props.autorouter ? {
|
|
7763
|
+
trace_clearance: props.autorouter.traceClearance
|
|
7764
|
+
} : void 0
|
|
7793
7765
|
});
|
|
7794
7766
|
this.pcb_group_id = pcb_group.pcb_group_id;
|
|
7795
7767
|
for (const child of this.children) {
|
|
@@ -10698,7 +10670,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
10698
10670
|
var package_default = {
|
|
10699
10671
|
name: "@tscircuit/core",
|
|
10700
10672
|
type: "module",
|
|
10701
|
-
version: "0.0.
|
|
10673
|
+
version: "0.0.540",
|
|
10702
10674
|
types: "dist/index.d.ts",
|
|
10703
10675
|
main: "dist/index.js",
|
|
10704
10676
|
module: "dist/index.js",
|
|
@@ -10730,9 +10702,9 @@ var package_default = {
|
|
|
10730
10702
|
"@tscircuit/layout": "^0.0.28",
|
|
10731
10703
|
"@tscircuit/log-soup": "^1.0.2",
|
|
10732
10704
|
"@tscircuit/math-utils": "^0.0.18",
|
|
10733
|
-
"@tscircuit/props": "^0.0.
|
|
10705
|
+
"@tscircuit/props": "^0.0.248",
|
|
10734
10706
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
10735
|
-
"@tscircuit/schematic-corpus": "^0.0.
|
|
10707
|
+
"@tscircuit/schematic-corpus": "^0.0.33",
|
|
10736
10708
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
10737
10709
|
"@tscircuit/simple-3d-svg": "^0.0.6",
|
|
10738
10710
|
"@types/bun": "^1.2.16",
|
|
@@ -10740,11 +10712,11 @@ var package_default = {
|
|
|
10740
10712
|
"@types/react": "^19.0.1",
|
|
10741
10713
|
"@types/react-dom": "^19.0.2",
|
|
10742
10714
|
"@types/react-reconciler": "^0.28.9",
|
|
10743
|
-
"bpc-graph": "^0.0.
|
|
10715
|
+
"bpc-graph": "^0.0.46",
|
|
10744
10716
|
"bun-match-svg": "0.0.11",
|
|
10745
10717
|
"calculate-elbow": "^0.0.5",
|
|
10746
10718
|
"chokidar-cli": "^3.0.0",
|
|
10747
|
-
"circuit-json": "^0.0.
|
|
10719
|
+
"circuit-json": "^0.0.215",
|
|
10748
10720
|
"circuit-json-to-bpc": "^0.0.7",
|
|
10749
10721
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
10750
10722
|
"circuit-json-to-simple-3d": "^0.0.2",
|
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.541",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@tscircuit/layout": "^0.0.28",
|
|
34
34
|
"@tscircuit/log-soup": "^1.0.2",
|
|
35
35
|
"@tscircuit/math-utils": "^0.0.18",
|
|
36
|
-
"@tscircuit/props": "^0.0.
|
|
36
|
+
"@tscircuit/props": "^0.0.248",
|
|
37
37
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
38
|
-
"@tscircuit/schematic-corpus": "^0.0.
|
|
38
|
+
"@tscircuit/schematic-corpus": "^0.0.33",
|
|
39
39
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
40
40
|
"@tscircuit/simple-3d-svg": "^0.0.6",
|
|
41
41
|
"@types/bun": "^1.2.16",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"@types/react": "^19.0.1",
|
|
44
44
|
"@types/react-dom": "^19.0.2",
|
|
45
45
|
"@types/react-reconciler": "^0.28.9",
|
|
46
|
-
"bpc-graph": "^0.0.
|
|
46
|
+
"bpc-graph": "^0.0.46",
|
|
47
47
|
"bun-match-svg": "0.0.11",
|
|
48
48
|
"calculate-elbow": "^0.0.5",
|
|
49
49
|
"chokidar-cli": "^3.0.0",
|
|
50
|
-
"circuit-json": "^0.0.
|
|
50
|
+
"circuit-json": "^0.0.215",
|
|
51
51
|
"circuit-json-to-bpc": "^0.0.7",
|
|
52
52
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
53
53
|
"circuit-json-to-simple-3d": "^0.0.2",
|