@tscircuit/core 0.0.1312 → 0.0.1314
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 +48 -36
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9767,8 +9767,12 @@ var Port = class extends PrimitiveComponent2 {
|
|
|
9767
9767
|
label: "obstacle"
|
|
9768
9768
|
});
|
|
9769
9769
|
}
|
|
9770
|
+
const isExplicitCustomSymbolPort = schX !== void 0 && schY !== void 0 && !!this._getSymbolAncestor();
|
|
9770
9771
|
if (!localPortInfo?.side) {
|
|
9771
9772
|
this.facingDirection = getRelativeDirection(containerCenter, portCenter);
|
|
9773
|
+
if (isExplicitCustomSymbolPort && props.direction) {
|
|
9774
|
+
this.facingDirection = props.direction;
|
|
9775
|
+
}
|
|
9772
9776
|
} else {
|
|
9773
9777
|
this.facingDirection = {
|
|
9774
9778
|
left: "left",
|
|
@@ -15714,7 +15718,7 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
15714
15718
|
};
|
|
15715
15719
|
}
|
|
15716
15720
|
const routedTraceIds = new Set(
|
|
15717
|
-
db.pcb_trace.list().filter((t) =>
|
|
15721
|
+
subcircuit_id ? db.pcb_trace.list().filter((t) => t.subcircuit_id === subcircuit_id).map((t) => t.source_trace_id).filter((id) => Boolean(id)) : []
|
|
15718
15722
|
);
|
|
15719
15723
|
const sourcePortIdToBreakoutPoint = /* @__PURE__ */ new Map();
|
|
15720
15724
|
for (const bp of breakoutPoints) {
|
|
@@ -15810,22 +15814,27 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
15810
15814
|
sourceTrace.min_trace_thickness
|
|
15811
15815
|
);
|
|
15812
15816
|
}
|
|
15813
|
-
|
|
15814
|
-
|
|
15815
|
-
|
|
15816
|
-
|
|
15817
|
-
|
|
15818
|
-
|
|
15819
|
-
|
|
15820
|
-
|
|
15821
|
-
return pcb_ports.map((p) => ({
|
|
15817
|
+
const pointsToConnect = [];
|
|
15818
|
+
const addedPointIds = /* @__PURE__ */ new Set();
|
|
15819
|
+
for (const st of connectedSourceTraces) {
|
|
15820
|
+
const pcb_ports = db.pcb_port.list().filter((p) => st.connected_source_port_ids.includes(p.source_port_id));
|
|
15821
|
+
for (const p of pcb_ports) {
|
|
15822
|
+
if (addedPointIds.has(p.pcb_port_id)) continue;
|
|
15823
|
+
addedPointIds.add(p.pcb_port_id);
|
|
15824
|
+
pointsToConnect.push({
|
|
15822
15825
|
x: p.x,
|
|
15823
15826
|
y: p.y,
|
|
15824
15827
|
layer: p.layers?.[0] ?? "top",
|
|
15825
15828
|
pointId: p.pcb_port_id,
|
|
15826
15829
|
pcb_port_id: p.pcb_port_id
|
|
15827
|
-
})
|
|
15828
|
-
}
|
|
15830
|
+
});
|
|
15831
|
+
}
|
|
15832
|
+
}
|
|
15833
|
+
connectionsFromNets.push({
|
|
15834
|
+
name: net.source_net_id ?? connMap.getNetConnectedToId(net.source_net_id),
|
|
15835
|
+
nominalTraceWidth: nominalTraceWidthFromConnectedTraces,
|
|
15836
|
+
width: nominalTraceWidthFromConnectedTraces,
|
|
15837
|
+
pointsToConnect
|
|
15829
15838
|
});
|
|
15830
15839
|
}
|
|
15831
15840
|
const connectionsFromBreakoutPoints = [];
|
|
@@ -15877,31 +15886,34 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
15877
15886
|
...connectionsFromNets,
|
|
15878
15887
|
...connectionsFromBreakoutPoints
|
|
15879
15888
|
];
|
|
15880
|
-
|
|
15881
|
-
|
|
15882
|
-
for (const
|
|
15883
|
-
|
|
15889
|
+
if (subcircuit_id) {
|
|
15890
|
+
const pointIdToConn = /* @__PURE__ */ new Map();
|
|
15891
|
+
for (const conn of allConns) {
|
|
15892
|
+
for (const pt of conn.pointsToConnect) {
|
|
15893
|
+
if (pt.pointId) pointIdToConn.set(pt.pointId, conn);
|
|
15894
|
+
}
|
|
15895
|
+
}
|
|
15896
|
+
const existingTraces = db.pcb_trace.list().filter((t) => {
|
|
15897
|
+
return relevantSubcircuitIds?.has(t.subcircuit_id);
|
|
15898
|
+
});
|
|
15899
|
+
for (const tr of existingTraces) {
|
|
15900
|
+
const tracePortIds = /* @__PURE__ */ new Set();
|
|
15901
|
+
for (const seg of tr.route) {
|
|
15902
|
+
if (seg.start_pcb_port_id) tracePortIds.add(seg.start_pcb_port_id);
|
|
15903
|
+
if (seg.end_pcb_port_id) tracePortIds.add(seg.end_pcb_port_id);
|
|
15904
|
+
}
|
|
15905
|
+
if (tracePortIds.size < 2) continue;
|
|
15906
|
+
const firstId = tracePortIds.values().next().value;
|
|
15907
|
+
if (!firstId) continue;
|
|
15908
|
+
const conn = pointIdToConn.get(firstId);
|
|
15909
|
+
if (!conn) continue;
|
|
15910
|
+
if (![...tracePortIds].every((pid) => pointIdToConn.get(pid) === conn)) {
|
|
15911
|
+
continue;
|
|
15912
|
+
}
|
|
15913
|
+
conn.externallyConnectedPointIds ??= [];
|
|
15914
|
+
conn.externallyConnectedPointIds.push([...tracePortIds]);
|
|
15884
15915
|
}
|
|
15885
15916
|
}
|
|
15886
|
-
const existingTraces = db.pcb_trace.list().filter(
|
|
15887
|
-
(t) => !subcircuit_id || relevantSubcircuitIds?.has(t.subcircuit_id)
|
|
15888
|
-
);
|
|
15889
|
-
for (const tr of existingTraces) {
|
|
15890
|
-
const tracePortIds = /* @__PURE__ */ new Set();
|
|
15891
|
-
for (const seg of tr.route) {
|
|
15892
|
-
if (seg.start_pcb_port_id) tracePortIds.add(seg.start_pcb_port_id);
|
|
15893
|
-
if (seg.end_pcb_port_id) tracePortIds.add(seg.end_pcb_port_id);
|
|
15894
|
-
}
|
|
15895
|
-
if (tracePortIds.size < 2) continue;
|
|
15896
|
-
const firstId = tracePortIds.values().next().value;
|
|
15897
|
-
if (!firstId) continue;
|
|
15898
|
-
const conn = pointIdToConn.get(firstId);
|
|
15899
|
-
if (!conn) continue;
|
|
15900
|
-
if (![...tracePortIds].every((pid) => pointIdToConn.get(pid) === conn))
|
|
15901
|
-
continue;
|
|
15902
|
-
conn.externallyConnectedPointIds ??= [];
|
|
15903
|
-
conn.externallyConnectedPointIds.push([...tracePortIds]);
|
|
15904
|
-
}
|
|
15905
15917
|
const resolvedMinViaHoleDiameter = minViaHoleDiameter ?? board?.min_via_hole_diameter;
|
|
15906
15918
|
const resolvedMinViaPadDiameter = minViaPadDiameter ?? board?.min_via_pad_diameter;
|
|
15907
15919
|
const resolvedMinTraceToPadEdgeClearance = minTraceToPadEdgeClearance ?? board?.min_trace_to_pad_edge_clearance;
|
|
@@ -23486,7 +23498,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
23486
23498
|
var package_default = {
|
|
23487
23499
|
name: "@tscircuit/core",
|
|
23488
23500
|
type: "module",
|
|
23489
|
-
version: "0.0.
|
|
23501
|
+
version: "0.0.1313",
|
|
23490
23502
|
types: "dist/index.d.ts",
|
|
23491
23503
|
main: "dist/index.js",
|
|
23492
23504
|
module: "dist/index.js",
|