@tscircuit/core 0.0.1380 → 0.0.1382

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 CHANGED
@@ -12,7 +12,7 @@ import { symbols, SchSymbol, BaseSymbolName } from 'schematic-symbols';
12
12
  import { CircuitJsonUtilObjects } from '@tscircuit/circuit-json-util';
13
13
  import { Matrix } from 'transformation-matrix';
14
14
  import { PackSolver2 } from 'calculate-packing';
15
- import { AutoroutingPipelineSolver, AssignableAutoroutingPipeline2, AssignableAutoroutingPipeline3, AutoroutingPipeline1_OriginalUnravel, AutoroutingPipelineSolver3_HgPortPointPathing, AutoroutingPipelineSolver5, AutoroutingPipelineSolver7_MultiGraph, AutoroutingPipelineSolver8, SimplifiedPcbTrace as SimplifiedPcbTrace$1, SimpleRouteJson as SimpleRouteJson$1 } from '@tscircuit/capacity-autorouter';
15
+ import { AutoroutingPipelineSolver, AssignableAutoroutingPipeline2, AssignableAutoroutingPipeline3, AutoroutingPipeline1_OriginalUnravel, AutoroutingPipelineSolver3_HgPortPointPathing, AutoroutingPipelineSolver4, AutoroutingPipelineSolver5, AutoroutingPipelineSolver8, SimplifiedPcbTrace as SimplifiedPcbTrace$1, SimpleRouteJson as SimpleRouteJson$1 } from '@tscircuit/capacity-autorouter';
16
16
  import { CopperPourPipelineSolver } from '@tscircuit/copper-pour-solver';
17
17
  import { Bounds } from '@tscircuit/math-utils';
18
18
  import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
@@ -25,9 +25,9 @@ declare const SOLVERS: {
25
25
  AssignableAutoroutingPipeline3: typeof AssignableAutoroutingPipeline3;
26
26
  AutoroutingPipeline1_OriginalUnravel: typeof AutoroutingPipeline1_OriginalUnravel;
27
27
  AutoroutingPipelineSolver3_HgPortPointPathing: typeof AutoroutingPipelineSolver3_HgPortPointPathing;
28
- AutoroutingPipelineSolver4: typeof AutoroutingPipelineSolver;
28
+ AutoroutingPipelineSolver4: typeof AutoroutingPipelineSolver4;
29
29
  AutoroutingPipelineSolver5: typeof AutoroutingPipelineSolver5;
30
- AutoroutingPipelineSolver7_MultiGraph: typeof AutoroutingPipelineSolver7_MultiGraph;
30
+ AutoroutingPipelineSolver7_MultiGraph: typeof AutoroutingPipelineSolver;
31
31
  AutoroutingPipelineSolver8: typeof AutoroutingPipelineSolver8;
32
32
  CopperPourPipelineSolver: typeof CopperPourPipelineSolver;
33
33
  };
package/dist/index.js CHANGED
@@ -4450,6 +4450,7 @@ import { distance as distance2, doesLineIntersectLine } from "@tscircuit/math-ut
4450
4450
  var getOtherSchematicTraces = ({
4451
4451
  db,
4452
4452
  source_trace_id,
4453
+ schematic_sheet_id,
4453
4454
  sameNetOnly,
4454
4455
  differentNetOnly
4455
4456
  }) => {
@@ -4460,6 +4461,9 @@ var getOtherSchematicTraces = ({
4460
4461
  const traces = [];
4461
4462
  for (const otherSchematicTrace of db.schematic_trace.list()) {
4462
4463
  if (otherSchematicTrace.source_trace_id === source_trace_id) continue;
4464
+ if (schematic_sheet_id !== void 0 && otherSchematicTrace.schematic_sheet_id !== schematic_sheet_id) {
4465
+ continue;
4466
+ }
4463
4467
  const otherSourceTrace = db.source_trace.get(
4464
4468
  otherSchematicTrace.source_trace_id
4465
4469
  );
@@ -4606,11 +4610,13 @@ var getIntersectionPoint = (edge1, edge2) => {
4606
4610
  var createSchematicTraceJunctions = ({
4607
4611
  edges: myEdges,
4608
4612
  db,
4609
- source_trace_id
4613
+ source_trace_id,
4614
+ schematic_sheet_id
4610
4615
  }) => {
4611
4616
  const otherEdges = getOtherSchematicTraces({
4612
4617
  db,
4613
4618
  source_trace_id,
4619
+ schematic_sheet_id,
4614
4620
  sameNetOnly: true
4615
4621
  }).flatMap((t) => t.edges);
4616
4622
  const junctions = /* @__PURE__ */ new Map();
@@ -4892,12 +4898,13 @@ import { doesLineIntersectLine as doesLineIntersectLine2 } from "@tscircuit/math
4892
4898
  var pushEdgesOfSchematicTraceToPreventOverlap = ({
4893
4899
  edges,
4894
4900
  db,
4895
- source_trace_id
4901
+ source_trace_id,
4902
+ schematic_sheet_id
4896
4903
  }) => {
4897
- const mySourceTrace = db.source_trace.get(source_trace_id);
4898
4904
  const otherEdges = getOtherSchematicTraces({
4899
4905
  db,
4900
4906
  source_trace_id,
4907
+ schematic_sheet_id,
4901
4908
  differentNetOnly: true
4902
4909
  }).flatMap((t) => t.edges);
4903
4910
  const edgeOrientation = (edge) => {
@@ -4953,6 +4960,7 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
4953
4960
  const { db } = trace.root;
4954
4961
  const { _parsedProps: props, parent } = trace;
4955
4962
  const schematicNetLabelText = trace._getSchematicNetLabelText();
4963
+ const schematicSheetId = trace._resolveSchematicSheetId();
4956
4964
  if (!parent) throw new Error("Trace has no parent");
4957
4965
  let allPortsFound;
4958
4966
  let connectedPorts;
@@ -5031,14 +5039,15 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
5031
5039
  const junctions2 = createSchematicTraceJunctions({
5032
5040
  edges: edges2,
5033
5041
  db,
5034
- source_trace_id: trace.source_trace_id
5042
+ source_trace_id: trace.source_trace_id,
5043
+ schematic_sheet_id: schematicSheetId
5035
5044
  });
5036
5045
  const dbTrace2 = db.schematic_trace.insert({
5037
5046
  source_trace_id: trace.source_trace_id,
5038
5047
  edges: edges2,
5039
5048
  junctions: junctions2,
5040
5049
  subcircuit_connectivity_map_key: trace.subcircuit_connectivity_map_key ?? void 0,
5041
- schematic_sheet_id: trace._resolveSchematicSheetId()
5050
+ schematic_sheet_id: schematicSheetId
5042
5051
  });
5043
5052
  trace.schematic_trace_id = dbTrace2.schematic_trace_id;
5044
5053
  return;
@@ -5233,17 +5242,24 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
5233
5242
  const source_trace_id = trace.source_trace_id;
5234
5243
  let junctions = [];
5235
5244
  if (!skipOtherTraceInteraction) {
5236
- pushEdgesOfSchematicTraceToPreventOverlap({ edges, db, source_trace_id });
5245
+ pushEdgesOfSchematicTraceToPreventOverlap({
5246
+ edges,
5247
+ db,
5248
+ source_trace_id,
5249
+ schematic_sheet_id: schematicSheetId
5250
+ });
5237
5251
  const otherEdges = getOtherSchematicTraces({
5238
5252
  db,
5239
5253
  source_trace_id,
5254
+ schematic_sheet_id: schematicSheetId,
5240
5255
  differentNetOnly: true
5241
5256
  }).flatMap((t) => t.edges);
5242
5257
  edges = createSchematicTraceCrossingSegments({ edges, otherEdges });
5243
5258
  junctions = createSchematicTraceJunctions({
5244
5259
  edges,
5245
5260
  db,
5246
- source_trace_id: trace.source_trace_id
5261
+ source_trace_id: trace.source_trace_id,
5262
+ schematic_sheet_id: schematicSheetId
5247
5263
  });
5248
5264
  }
5249
5265
  if (!edges || edges.length === 0) {
@@ -5275,7 +5291,7 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
5275
5291
  edges,
5276
5292
  junctions,
5277
5293
  subcircuit_connectivity_map_key: trace.subcircuit_connectivity_map_key ?? void 0,
5278
- schematic_sheet_id: trace._resolveSchematicSheetId()
5294
+ schematic_sheet_id: schematicSheetId
5279
5295
  });
5280
5296
  trace.schematic_trace_id = dbTrace.schematic_trace_id;
5281
5297
  for (const { port } of connectedPorts) {
@@ -20338,8 +20354,10 @@ function applyTracesFromSolverOutput(args) {
20338
20354
  }))
20339
20355
  );
20340
20356
  const existingTracesForJunctions = [];
20357
+ const schematicSheetId = group._resolveSchematicSheetId();
20341
20358
  for (const t of db.schematic_trace.list()) {
20342
20359
  if (t.edges.length === 0) continue;
20360
+ if (t.schematic_sheet_id !== schematicSheetId) continue;
20343
20361
  const sourceTrace = t.source_trace_id ? db.source_trace.get(t.source_trace_id) : void 0;
20344
20362
  existingTracesForJunctions.push({
20345
20363
  schematic_trace_id: t.schematic_trace_id,
@@ -20377,7 +20395,7 @@ function applyTracesFromSolverOutput(args) {
20377
20395
  subcircuit_connectivity_map_key: pendingTraces.find(
20378
20396
  (p) => p.source_trace_id === t.source_trace_id
20379
20397
  )?.subcircuit_connectivity_map_key,
20380
- schematic_sheet_id: group._resolveSchematicSheetId()
20398
+ schematic_sheet_id: schematicSheetId
20381
20399
  });
20382
20400
  }
20383
20401
  }
@@ -24854,7 +24872,7 @@ import { identity as identity5 } from "transformation-matrix";
24854
24872
  var package_default = {
24855
24873
  name: "@tscircuit/core",
24856
24874
  type: "module",
24857
- version: "0.0.1379",
24875
+ version: "0.0.1381",
24858
24876
  types: "dist/index.d.ts",
24859
24877
  main: "dist/index.js",
24860
24878
  module: "dist/index.js",
@@ -24887,7 +24905,7 @@ var package_default = {
24887
24905
  "@resvg/resvg-js": "^2.6.2",
24888
24906
  "@tscircuit/alphabet": "0.0.25",
24889
24907
  "@tscircuit/breakout-point-solver": "github:tscircuit/breakout-point-solver#bac9629",
24890
- "@tscircuit/capacity-autorouter": "^0.0.583",
24908
+ "@tscircuit/capacity-autorouter": "^0.0.624",
24891
24909
  "@tscircuit/checks": "0.0.140",
24892
24910
  "@tscircuit/circuit-json-util": "^0.0.97",
24893
24911
  "@tscircuit/common": "^0.0.20",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1380",
4
+ "version": "0.0.1382",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -34,7 +34,7 @@
34
34
  "@resvg/resvg-js": "^2.6.2",
35
35
  "@tscircuit/alphabet": "0.0.25",
36
36
  "@tscircuit/breakout-point-solver": "github:tscircuit/breakout-point-solver#bac9629",
37
- "@tscircuit/capacity-autorouter": "^0.0.583",
37
+ "@tscircuit/capacity-autorouter": "^0.0.624",
38
38
  "@tscircuit/checks": "0.0.140",
39
39
  "@tscircuit/circuit-json-util": "^0.0.97",
40
40
  "@tscircuit/common": "^0.0.20",