@tscircuit/core 0.0.1462 → 0.0.1464

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.
Files changed (2) hide show
  1. package/dist/index.js +39 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3122,7 +3122,7 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
3122
3122
  }
3123
3123
  ];
3124
3124
  }),
3125
- element.source_trace_id
3125
+ element.source_trace_id ?? element.pcb_trace_id
3126
3126
  );
3127
3127
  obstacles.push(
3128
3128
  ...traceObstacles.map((obstacle) => ({
@@ -16686,6 +16686,8 @@ var getSimpleRouteJsonFromCircuitJson = ({
16686
16686
  ...db.pcb_smtpad.list(),
16687
16687
  ...db.pcb_plated_hole.list(),
16688
16688
  ...db.pcb_hole.list(),
16689
+ // Footprint copper primitives such as solder-jumper bridges are fixed.
16690
+ ...db.pcb_trace.list().filter((trace) => !trace.source_trace_id),
16689
16691
  ...db.pcb_via.list().filter(
16690
16692
  (via) => !ignoreExistingTopLevelPcbRouteState || Boolean(via.subcircuit_id)
16691
16693
  ),
@@ -16905,8 +16907,42 @@ var getSimpleRouteJsonFromCircuitJson = ({
16905
16907
  const connectionsFromNets = [];
16906
16908
  const connectionFromNetId = /* @__PURE__ */ new Map();
16907
16909
  const handledNetConnectivityKeys = /* @__PURE__ */ new Set();
16910
+ const sourceNetIds = new Set(source_nets.map((net) => net.source_net_id));
16911
+ const currentSubcircuitSourceTraces = db.source_trace.list().filter((trace) => !subcircuit_id || trace.subcircuit_id === subcircuit_id);
16912
+ const exposedBridgeSourceTraceIds = new Set(
16913
+ (subcircuitComponent?.selectAll("trace") ?? []).flatMap((trace) => {
16914
+ const candidate = trace;
16915
+ return candidate._exposesSubcircuitConnection && candidate.source_trace_id ? [candidate.source_trace_id] : [];
16916
+ })
16917
+ );
16918
+ const exposedDescendantSourceNetIds = /* @__PURE__ */ new Set();
16919
+ for (const trace of currentSubcircuitSourceTraces) {
16920
+ if (!exposedBridgeSourceTraceIds.has(trace.source_trace_id)) {
16921
+ continue;
16922
+ }
16923
+ for (const sourceNetId of trace.connected_source_net_ids ?? []) {
16924
+ if (!sourceNetIds.has(sourceNetId)) {
16925
+ exposedDescendantSourceNetIds.add(sourceNetId);
16926
+ }
16927
+ }
16928
+ }
16929
+ const routedDescendantSourceTraceIds = new Set(
16930
+ subcircuit_id ? db.pcb_trace.list().filter(
16931
+ (trace) => trace.subcircuit_id && trace.subcircuit_id !== subcircuit_id && relevantSubcircuitIds?.has(trace.subcircuit_id)
16932
+ ).map((trace) => trace.source_trace_id).filter((id) => Boolean(id)) : []
16933
+ );
16908
16934
  const sourceTracesEligibleForNetConnections = db.source_trace.list().filter(
16909
- (st) => subcircuit_id || !sourceTraceIdsAlreadyPreservedAsSrjTraces.has(st.source_trace_id)
16935
+ (trace) => (
16936
+ // Existing copper must still contribute endpoint connectivity when it
16937
+ // belongs to the scope currently being routed. Descendant copper is
16938
+ // preserved as static geometry only, preventing it from being routed
16939
+ // a second time by its parent.
16940
+ !sourceTraceIdsAlreadyPreservedAsSrjTraces.has(trace.source_trace_id) || subcircuit_id != null && trace.subcircuit_id === subcircuit_id
16941
+ )
16942
+ ).filter(
16943
+ (trace) => !subcircuit_id || trace.subcircuit_id === subcircuit_id || (trace.connected_source_net_ids?.some((id) => sourceNetIds.has(id)) ?? false) || (trace.connected_source_net_ids?.some(
16944
+ (id) => exposedDescendantSourceNetIds.has(id)
16945
+ ) ?? false) && !routedDescendantSourceTraceIds.has(trace.source_trace_id)
16910
16946
  );
16911
16947
  const getSourceConnectivityKey = (id) => id ? sharedConnMap.getNetConnectedToId(id) ?? id : null;
16912
16948
  for (const net of source_nets) {
@@ -22863,7 +22899,7 @@ function Group_getRoutingPhasePlans(group) {
22863
22899
  var package_default = {
22864
22900
  name: "@tscircuit/core",
22865
22901
  type: "module",
22866
- version: "0.0.1461",
22902
+ version: "0.0.1463",
22867
22903
  types: "dist/index.d.ts",
22868
22904
  main: "dist/index.js",
22869
22905
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1462",
4
+ "version": "0.0.1464",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",