@tscircuit/core 0.0.1919 → 0.0.1920

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 +23 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -18275,8 +18275,8 @@ import {
18275
18275
  } from "circuit-json";
18276
18276
  import Debug15 from "debug";
18277
18277
 
18278
- // lib/utils/autorouting/with-fixed-fanout-traces.ts
18279
- function withFixedFanoutTraces(input, fixedTraceIds) {
18278
+ // lib/utils/autorouting/with-fixed-traces.ts
18279
+ function withFixedTraces(input, fixedTraceIds) {
18280
18280
  if (fixedTraceIds.size === 0) return input;
18281
18281
  const fixedTraces = (input.traces ?? []).filter(
18282
18282
  (trace) => fixedTraceIds.has(trace.pcb_trace_id)
@@ -63283,7 +63283,7 @@ function Group_getRoutingPhasePlans(group) {
63283
63283
  var package_default = {
63284
63284
  name: "@tscircuit/core",
63285
63285
  type: "module",
63286
- version: "0.0.1918",
63286
+ version: "0.0.1919",
63287
63287
  types: "dist/index.d.ts",
63288
63288
  main: "dist/index.js",
63289
63289
  module: "dist/index.js",
@@ -65304,7 +65304,17 @@ var Group5 = class extends NormalComponent3 {
65304
65304
  );
65305
65305
  });
65306
65306
  };
65307
- const fixedFanoutTraceIds = /* @__PURE__ */ new Set();
65307
+ const manualSourceTraceIds = new Set(
65308
+ this.getDescendants().filter(
65309
+ (child) => child instanceof Trace && !child.getSubcircuit()._isInflatedFromCircuitJson && Boolean(child._parsedProps.pcbPath?.length)
65310
+ ).map((trace) => trace.source_trace_id)
65311
+ );
65312
+ const manualPcbTraceIds = new Set(
65313
+ db.pcb_trace.list().filter(
65314
+ (trace) => trace.source_trace_id && manualSourceTraceIds.has(trace.source_trace_id)
65315
+ ).map((trace) => trace.pcb_trace_id)
65316
+ );
65317
+ const fixedTraceIds = new Set(manualPcbTraceIds);
65308
65318
  let previousStageOutputSimpleRouteJson;
65309
65319
  const skippedRemainingPhases = /* @__PURE__ */ new Set();
65310
65320
  for (const [
@@ -65411,9 +65421,14 @@ var Group5 = class extends NormalComponent3 {
65411
65421
  };
65412
65422
  }
65413
65423
  if (phaseAutorouterConfig.preset !== "bus_lanes") {
65414
- simpleRouteJson = withFixedFanoutTraces(
65424
+ const preservesManualTraceGeometry = !phaseAutorouterConfig.algorithmFn && (phaseAutorouterConfig.preset === "fanout" || phaseAutorouterConfig.preset === "single_layer_fanout");
65425
+ simpleRouteJson = withFixedTraces(
65415
65426
  simpleRouteJson,
65416
- fixedFanoutTraceIds
65427
+ preservesManualTraceGeometry ? new Set(
65428
+ [...fixedTraceIds].filter(
65429
+ (pcbTraceId) => !manualPcbTraceIds.has(pcbTraceId)
65430
+ )
65431
+ ) : fixedTraceIds
65417
65432
  );
65418
65433
  }
65419
65434
  simpleRouteJson = Group_applyDrcTolerancesToSimpleRouteJson(
@@ -65557,8 +65572,7 @@ var Group5 = class extends NormalComponent3 {
65557
65572
  const result = getPrecomputedRoutingResult(simpleRouteJson);
65558
65573
  traces = result.traces;
65559
65574
  precomputedOutputSimpleRouteJson = result.outputSimpleRouteJson;
65560
- for (const trace of traces)
65561
- fixedFanoutTraceIds.add(trace.pcb_trace_id);
65575
+ for (const trace of traces) fixedTraceIds.add(trace.pcb_trace_id);
65562
65576
  } else if (cachedResult) {
65563
65577
  debug13(`[${this.getString()}] using cached local autorouting result`);
65564
65578
  traces = cachedResult.traces;
@@ -65736,6 +65750,7 @@ var Group5 = class extends NormalComponent3 {
65736
65750
  } else {
65737
65751
  if (isTraceSimplificationPhase) {
65738
65752
  for (const existingTrace of existingRerouteSeedTraces) {
65753
+ if (fixedTraceIds.has(existingTrace.pcb_trace_id)) continue;
65739
65754
  pcbTraceIdsToDelete.add(existingTrace.pcb_trace_id);
65740
65755
  }
65741
65756
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1919",
4
+ "version": "0.0.1920",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",