@tscircuit/core 0.0.1459 → 0.0.1461

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 (3) hide show
  1. package/dist/index.d.ts +1642 -1630
  2. package/dist/index.js +104 -76
  3. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -173,14 +173,18 @@ var computeObstacleBounds = (obstacles) => {
173
173
  };
174
174
 
175
175
  // lib/utils/autorouting/findPossibleTraceLayerCombinations.ts
176
- var LAYER_SELECTION_PREFERENCE = ["top", "bottom", "inner1", "inner2"];
177
- var findPossibleTraceLayerCombinations = (hints, layer_path = []) => {
176
+ var DEFAULT_LAYER_SELECTION_PREFERENCE = ["top", "bottom", "inner1", "inner2"];
177
+ var findPossibleTraceLayerCombinationsRecursive = (hints, layerSelectionPreference, layer_path) => {
178
178
  const candidates = [];
179
179
  if (layer_path.length === 0) {
180
180
  const starting_layers = hints[0].layers;
181
181
  for (const layer of starting_layers) {
182
182
  candidates.push(
183
- ...findPossibleTraceLayerCombinations(hints.slice(1), [layer])
183
+ ...findPossibleTraceLayerCombinationsRecursive(
184
+ hints.slice(1),
185
+ layerSelectionPreference,
186
+ [layer]
187
+ )
184
188
  );
185
189
  }
186
190
  return candidates;
@@ -207,24 +211,31 @@ var findPossibleTraceLayerCombinations = (hints, layer_path = []) => {
207
211
  return [];
208
212
  }
209
213
  }
210
- return findPossibleTraceLayerCombinations(
214
+ return findPossibleTraceLayerCombinationsRecursive(
211
215
  hints.slice(1),
216
+ layerSelectionPreference,
212
217
  layer_path.concat([last_layer])
213
218
  );
214
219
  }
215
- const candidate_next_layers = (current_hint.optional_via ? LAYER_SELECTION_PREFERENCE : LAYER_SELECTION_PREFERENCE.filter((layer) => layer !== last_layer)).filter(
220
+ const candidate_next_layers = (current_hint.optional_via ? layerSelectionPreference : layerSelectionPreference.filter((layer) => layer !== last_layer)).filter(
216
221
  (layer) => !current_hint.layers || current_hint.layers?.includes(layer)
217
222
  );
218
223
  for (const candidate_next_layer of candidate_next_layers) {
219
224
  candidates.push(
220
- ...findPossibleTraceLayerCombinations(
225
+ ...findPossibleTraceLayerCombinationsRecursive(
221
226
  hints.slice(1),
227
+ layerSelectionPreference,
222
228
  layer_path.concat(candidate_next_layer)
223
229
  )
224
230
  );
225
231
  }
226
232
  return candidates;
227
233
  };
234
+ var findPossibleTraceLayerCombinations = (hints, options = {}) => findPossibleTraceLayerCombinationsRecursive(
235
+ hints,
236
+ options.layerSelectionPreference ?? DEFAULT_LAYER_SELECTION_PREFERENCE,
237
+ []
238
+ );
228
239
 
229
240
  // lib/utils/autorouting/getDominantDirection.ts
230
241
  function getDominantDirection(edge) {
@@ -2554,6 +2565,41 @@ var isRouteOutsideBoard = ({
2554
2565
  );
2555
2566
  };
2556
2567
 
2568
+ // lib/utils/getViaSpanLayers.ts
2569
+ var getViaSpanLayers = ({
2570
+ fromLayer,
2571
+ toLayer,
2572
+ layerCount
2573
+ }) => {
2574
+ if (fromLayer === toLayer) return [fromLayer];
2575
+ const stack = ["top"];
2576
+ for (let i = 1; i <= layerCount - 2; i++) {
2577
+ stack.push(`inner${i}`);
2578
+ }
2579
+ stack.push("bottom");
2580
+ const fromIndex = stack.indexOf(fromLayer);
2581
+ const toIndex = stack.indexOf(toLayer);
2582
+ if (fromIndex === -1 || toIndex === -1) return [fromLayer, toLayer];
2583
+ return fromIndex <= toIndex ? stack.slice(fromIndex, toIndex + 1) : stack.slice(toIndex, fromIndex + 1).reverse();
2584
+ };
2585
+ var getViaBoardLayers = (layerCount) => {
2586
+ if (layerCount <= 1) return ["top"];
2587
+ return getViaSpanLayers({
2588
+ fromLayer: "top",
2589
+ toLayer: "bottom",
2590
+ layerCount
2591
+ });
2592
+ };
2593
+ var getBoardAvailableLayers = (layerCount) => {
2594
+ const physicalLayerStack = getViaBoardLayers(layerCount);
2595
+ if (physicalLayerStack.length <= 1) return physicalLayerStack;
2596
+ return [
2597
+ physicalLayerStack[0],
2598
+ physicalLayerStack[physicalLayerStack.length - 1],
2599
+ ...physicalLayerStack.slice(1, -1)
2600
+ ];
2601
+ };
2602
+
2557
2603
  // lib/utils/obstacles/fillCircleWithRects.ts
2558
2604
  function fillCircleWithRects(circle, options = {}) {
2559
2605
  const { center, radius } = circle;
@@ -2703,7 +2749,6 @@ var getObstaclesFromRoute = (route, source_trace_id, { viaDiameter = 0.5 } = {})
2703
2749
  };
2704
2750
 
2705
2751
  // lib/utils/obstacles/getObstaclesFromCircuitJson.ts
2706
- var EVERY_LAYER = ["top", "inner1", "inner2", "bottom"];
2707
2752
  var QUARTER_TURN_TOLERANCE_DEGREES = 0.01;
2708
2753
  var getAxisAlignedRectFromRotatedRect = (rotatedRect) => {
2709
2754
  const normalizedRotation = (rotatedRect.rotation % 360 + 360) % 360;
@@ -2724,6 +2769,8 @@ var getAxisAlignedRectFromRotatedRect = (rotatedRect) => {
2724
2769
  return null;
2725
2770
  };
2726
2771
  var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
2772
+ const board = circuitJson.find((element) => element.type === "pcb_board");
2773
+ const everyLayer = getViaBoardLayers(board?.num_layers ?? 4);
2727
2774
  const withNetId = (idList) => connMap ? idList.concat(
2728
2775
  idList.map((id) => connMap?.getNetConnectedToId(id)).filter(Boolean)
2729
2776
  ) : idList;
@@ -2852,7 +2899,7 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
2852
2899
  obstacles.push({
2853
2900
  componentId: pcbComponentId,
2854
2901
  type: "rect",
2855
- layers: EVERY_LAYER,
2902
+ layers: everyLayer,
2856
2903
  center: {
2857
2904
  x: element.center.x,
2858
2905
  y: element.center.y
@@ -2873,7 +2920,7 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
2873
2920
  obstacles.push({
2874
2921
  componentId: pcbComponentId,
2875
2922
  type: "rect",
2876
- layers: EVERY_LAYER,
2923
+ layers: everyLayer,
2877
2924
  center: rect.center,
2878
2925
  width: rect.width,
2879
2926
  height: rect.height,
@@ -2888,7 +2935,7 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
2888
2935
  obstacles.push({
2889
2936
  componentId: pcbComponentId,
2890
2937
  type: "rect",
2891
- layers: EVERY_LAYER,
2938
+ layers: everyLayer,
2892
2939
  center: rect.center,
2893
2940
  width: rect.width,
2894
2941
  height: rect.height,
@@ -2902,6 +2949,7 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
2902
2949
  componentId: pcbComponentId,
2903
2950
  // @ts-ignore
2904
2951
  type: "oval",
2952
+ layers: everyLayer,
2905
2953
  center: {
2906
2954
  x: element.x,
2907
2955
  y: element.y
@@ -2914,7 +2962,7 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
2914
2962
  obstacles.push({
2915
2963
  componentId: pcbComponentId,
2916
2964
  type: "rect",
2917
- layers: EVERY_LAYER,
2965
+ layers: everyLayer,
2918
2966
  center: {
2919
2967
  x: element.x,
2920
2968
  y: element.y
@@ -2928,7 +2976,7 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
2928
2976
  obstacles.push({
2929
2977
  componentId: pcbComponentId,
2930
2978
  type: "rect",
2931
- layers: EVERY_LAYER,
2979
+ layers: everyLayer,
2932
2980
  center: {
2933
2981
  x: element.x,
2934
2982
  y: element.y
@@ -2941,7 +2989,7 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
2941
2989
  obstacles.push({
2942
2990
  componentId: pcbComponentId,
2943
2991
  type: "rect",
2944
- layers: EVERY_LAYER,
2992
+ layers: everyLayer,
2945
2993
  center: {
2946
2994
  x: element.x,
2947
2995
  y: element.y
@@ -2957,7 +3005,7 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
2957
3005
  obstacles.push({
2958
3006
  componentId: pcbComponentId,
2959
3007
  type: "rect",
2960
- layers: EVERY_LAYER,
3008
+ layers: everyLayer,
2961
3009
  center: {
2962
3010
  x: element.x,
2963
3011
  y: element.y
@@ -2973,7 +3021,7 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
2973
3021
  componentId: pcbComponentId,
2974
3022
  // @ts-ignore
2975
3023
  type: "oval",
2976
- layers: EVERY_LAYER,
3024
+ layers: everyLayer,
2977
3025
  center: {
2978
3026
  x: element.x,
2979
3027
  y: element.y
@@ -2987,7 +3035,7 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
2987
3035
  componentId: pcbComponentId,
2988
3036
  // @ts-ignore
2989
3037
  type: "rect",
2990
- layers: EVERY_LAYER,
3038
+ layers: everyLayer,
2991
3039
  center: {
2992
3040
  x: element.x,
2993
3041
  y: element.y
@@ -3001,7 +3049,7 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
3001
3049
  componentId: pcbComponentId,
3002
3050
  // @ts-ignore
3003
3051
  type: "oval",
3004
- layers: EVERY_LAYER,
3052
+ layers: everyLayer,
3005
3053
  center: {
3006
3054
  x: element.x,
3007
3055
  y: element.y
@@ -3014,7 +3062,7 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
3014
3062
  obstacles.push({
3015
3063
  componentId: pcbComponentId,
3016
3064
  type: "rect",
3017
- layers: EVERY_LAYER,
3065
+ layers: everyLayer,
3018
3066
  center: {
3019
3067
  x: element.x,
3020
3068
  y: element.y
@@ -3038,7 +3086,7 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
3038
3086
  componentId: pcbComponentId,
3039
3087
  // @ts-ignore
3040
3088
  type: "rect",
3041
- layers: EVERY_LAYER,
3089
+ layers: everyLayer,
3042
3090
  center: {
3043
3091
  x: centerX,
3044
3092
  y: centerY
@@ -3722,32 +3770,6 @@ var jlcMinTolerances = {
3722
3770
  min_via_pad_diameter: 0.3
3723
3771
  };
3724
3772
 
3725
- // lib/utils/getViaSpanLayers.ts
3726
- var getViaSpanLayers = ({
3727
- fromLayer,
3728
- toLayer,
3729
- layerCount
3730
- }) => {
3731
- if (fromLayer === toLayer) return [fromLayer];
3732
- const stack = ["top"];
3733
- for (let i = 1; i <= layerCount - 2; i++) {
3734
- stack.push(`inner${i}`);
3735
- }
3736
- stack.push("bottom");
3737
- const fromIndex = stack.indexOf(fromLayer);
3738
- const toIndex = stack.indexOf(toLayer);
3739
- if (fromIndex === -1 || toIndex === -1) return [fromLayer, toLayer];
3740
- return fromIndex <= toIndex ? stack.slice(fromIndex, toIndex + 1) : stack.slice(toIndex, fromIndex + 1).reverse();
3741
- };
3742
- var getViaBoardLayers = (layerCount) => {
3743
- if (layerCount <= 1) return ["top"];
3744
- return getViaSpanLayers({
3745
- fromLayer: "top",
3746
- toLayer: "bottom",
3747
- layerCount
3748
- });
3749
- };
3750
-
3751
3773
  // lib/components/primitive-components/Trace/Trace_doInitialPcbManualTraceRender.ts
3752
3774
  var findInflatedPcbViaForPoint = (vias, point6) => {
3753
3775
  if (point6.route_type !== "via") return void 0;
@@ -4354,7 +4376,12 @@ function Trace_doInitialPcbTraceRender(trace) {
4354
4376
  ];
4355
4377
  }
4356
4378
  const candidateLayerCombinations = findPossibleTraceLayerCombinations(
4357
- orderedRouteObjectives
4379
+ orderedRouteObjectives,
4380
+ {
4381
+ layerSelectionPreference: getBoardAvailableLayers(
4382
+ subcircuit._getSubcircuitLayerCount()
4383
+ )
4384
+ }
4358
4385
  );
4359
4386
  if (SHOULD_USE_SINGLE_LAYER_ROUTING && candidateLayerCombinations.length === 0) {
4360
4387
  trace.renderError(
@@ -7662,7 +7689,7 @@ var PlatedHole = class extends PrimitiveComponent2 {
7662
7689
  };
7663
7690
  }
7664
7691
  getAvailablePcbLayers() {
7665
- return ["top", "inner1", "inner2", "bottom"];
7692
+ return [...this.root?._getBoard()?.allLayers ?? ["top", "bottom"]];
7666
7693
  }
7667
7694
  getPcbSize() {
7668
7695
  const { _parsedProps: props } = this;
@@ -7747,6 +7774,7 @@ var PlatedHole = class extends PrimitiveComponent2 {
7747
7774
  const position = this._getGlobalPcbPositionBeforeLayout();
7748
7775
  const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id;
7749
7776
  const subcircuit = this.getSubcircuit();
7777
+ const platedHoleLayers = this.getAvailablePcbLayers();
7750
7778
  const soldermaskMargin = props.solderMaskMargin;
7751
7779
  const isCoveredWithSolderMask = props.coveredWithSolderMask ?? false;
7752
7780
  this.emitSolderMaskMarginWarning(isCoveredWithSolderMask, soldermaskMargin);
@@ -7767,7 +7795,7 @@ var PlatedHole = class extends PrimitiveComponent2 {
7767
7795
  port_hints: this.getNameAndAliases(),
7768
7796
  x: position.x,
7769
7797
  y: position.y,
7770
- layers: ["top", "bottom"],
7798
+ layers: platedHoleLayers,
7771
7799
  soldermask_margin: soldermaskMargin,
7772
7800
  is_covered_with_solder_mask: isCoveredWithSolderMask,
7773
7801
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
@@ -7808,7 +7836,7 @@ var PlatedHole = class extends PrimitiveComponent2 {
7808
7836
  pcb_plated_hole_id: this.pcb_plated_hole_id,
7809
7837
  x: position.x,
7810
7838
  y: position.y,
7811
- layers: ["top", "bottom"],
7839
+ layers: platedHoleLayers,
7812
7840
  soldermask_margin: soldermaskMargin,
7813
7841
  is_covered_with_solder_mask: isCoveredWithSolderMask,
7814
7842
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
@@ -7835,7 +7863,7 @@ var PlatedHole = class extends PrimitiveComponent2 {
7835
7863
  port_hints: this.getNameAndAliases(),
7836
7864
  x: position.x,
7837
7865
  y: position.y,
7838
- layers: ["top", "bottom"],
7866
+ layers: platedHoleLayers,
7839
7867
  soldermask_margin: soldermaskMargin,
7840
7868
  is_covered_with_solder_mask: isCoveredWithSolderMask,
7841
7869
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
@@ -7877,7 +7905,7 @@ var PlatedHole = class extends PrimitiveComponent2 {
7877
7905
  port_hints: this.getNameAndAliases(),
7878
7906
  x: position.x,
7879
7907
  y: position.y,
7880
- layers: ["top", "bottom"],
7908
+ layers: platedHoleLayers,
7881
7909
  soldermask_margin: soldermaskMargin,
7882
7910
  is_covered_with_solder_mask: isCoveredWithSolderMask,
7883
7911
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
@@ -7909,7 +7937,7 @@ var PlatedHole = class extends PrimitiveComponent2 {
7909
7937
  port_hints: this.getNameAndAliases(),
7910
7938
  x: position.x,
7911
7939
  y: position.y,
7912
- layers: ["top", "bottom"],
7940
+ layers: platedHoleLayers,
7913
7941
  soldermask_margin: soldermaskMargin,
7914
7942
  is_covered_with_solder_mask: isCoveredWithSolderMask,
7915
7943
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
@@ -7931,7 +7959,7 @@ var PlatedHole = class extends PrimitiveComponent2 {
7931
7959
  port_hints: this.getNameAndAliases(),
7932
7960
  x: position.x,
7933
7961
  y: position.y,
7934
- layers: ["top", "bottom"],
7962
+ layers: platedHoleLayers,
7935
7963
  soldermask_margin: soldermaskMargin,
7936
7964
  is_covered_with_solder_mask: isCoveredWithSolderMask,
7937
7965
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
@@ -7962,7 +7990,7 @@ var PlatedHole = class extends PrimitiveComponent2 {
7962
7990
  port_hints: this.getNameAndAliases(),
7963
7991
  x: position.x,
7964
7992
  y: position.y,
7965
- layers: ["top", "bottom"],
7993
+ layers: platedHoleLayers,
7966
7994
  soldermask_margin: soldermaskMargin,
7967
7995
  is_covered_with_solder_mask: isCoveredWithSolderMask,
7968
7996
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
@@ -16653,6 +16681,7 @@ var getSimpleRouteJsonFromCircuitJson = ({
16653
16681
  );
16654
16682
  const obstacles = getObstaclesFromCircuitJson(
16655
16683
  [
16684
+ ...board ? [board] : [],
16656
16685
  ...db.pcb_component.list(),
16657
16686
  ...db.pcb_smtpad.list(),
16658
16687
  ...db.pcb_plated_hole.list(),
@@ -16663,7 +16692,7 @@ var getSimpleRouteJsonFromCircuitJson = ({
16663
16692
  ...db.pcb_keepout.list(),
16664
16693
  ...db.pcb_cutout.list()
16665
16694
  ].filter(
16666
- (e) => !subcircuit_id || relevantSubcircuitIds?.has(e.subcircuit_id)
16695
+ (e) => e.type === "pcb_board" || !subcircuit_id || relevantSubcircuitIds?.has(e.subcircuit_id)
16667
16696
  ),
16668
16697
  sharedConnMap
16669
16698
  );
@@ -22834,7 +22863,7 @@ function Group_getRoutingPhasePlans(group) {
22834
22863
  var package_default = {
22835
22864
  name: "@tscircuit/core",
22836
22865
  type: "module",
22837
- version: "0.0.1458",
22866
+ version: "0.0.1460",
22838
22867
  types: "dist/index.d.ts",
22839
22868
  main: "dist/index.js",
22840
22869
  module: "dist/index.js",
@@ -22883,9 +22912,9 @@ var package_default = {
22883
22912
  "@tscircuit/math-utils": "^0.0.36",
22884
22913
  "@tscircuit/miniflex": "^0.0.4",
22885
22914
  "@tscircuit/ngspice-spice-engine": "^0.0.19",
22886
- "@tscircuit/props": "^0.0.578",
22915
+ "@tscircuit/props": "^0.0.583",
22887
22916
  "@tscircuit/schematic-match-adapt": "^0.0.18",
22888
- "@tscircuit/schematic-trace-solver": "^0.0.99",
22917
+ "@tscircuit/schematic-trace-solver": "^0.0.101",
22889
22918
  "@tscircuit/solver-utils": "^0.0.16",
22890
22919
  "@tscircuit/soup-util": "^0.0.41",
22891
22920
  "@types/bun": "^1.2.16",
@@ -22897,7 +22926,7 @@ var package_default = {
22897
22926
  "bun-match-svg": "0.0.12",
22898
22927
  "calculate-elbow": "^0.0.12",
22899
22928
  "chokidar-cli": "^3.0.0",
22900
- "circuit-json": "^0.0.447",
22929
+ "circuit-json": "^0.0.450",
22901
22930
  "circuit-json-to-bpc": "^0.0.13",
22902
22931
  "circuit-json-to-connectivity-map": "^0.0.23",
22903
22932
  "circuit-json-to-gltf": "^0.0.105",
@@ -23078,23 +23107,25 @@ function createJumperObstacle(point6, connectedTo, obstacleIndex) {
23078
23107
  connectedTo: [connectedTo]
23079
23108
  };
23080
23109
  }
23081
- function createViaObstacle(point6, connectedTo, obstacleIndex) {
23110
+ function createViaObstacle(point6, connectedTo, obstacleIndex, layerCount) {
23082
23111
  return {
23083
23112
  obstacleId: `${connectedTo}_phase_via_obstacle_${obstacleIndex}`,
23084
23113
  type: "rect",
23085
- layers: [point6.from_layer, point6.to_layer],
23114
+ layers: getViaBoardLayers(layerCount),
23086
23115
  center: { x: point6.x, y: point6.y },
23087
23116
  width: 0.6,
23088
23117
  height: 0.6,
23089
23118
  connectedTo: [connectedTo]
23090
23119
  };
23091
23120
  }
23092
- function addTraceObstacles(obstacles, trace) {
23121
+ function addTraceObstacles(obstacles, trace, layerCount) {
23093
23122
  const connectedTo = getTraceConnectionName(trace);
23094
23123
  for (let routeIndex = 0; routeIndex < trace.route.length; routeIndex++) {
23095
23124
  const routePoint = trace.route[routeIndex];
23096
23125
  if (isViaPoint(routePoint)) {
23097
- obstacles.push(createViaObstacle(routePoint, connectedTo, routeIndex));
23126
+ obstacles.push(
23127
+ createViaObstacle(routePoint, connectedTo, routeIndex, layerCount)
23128
+ );
23098
23129
  } else if (isJumperPoint(routePoint)) {
23099
23130
  obstacles.push(createJumperObstacle(routePoint, connectedTo, routeIndex));
23100
23131
  }
@@ -23209,10 +23240,10 @@ function Group_applyDrcTolerancesToSimpleRouteJson(simpleRouteJson, drcTolerance
23209
23240
  minBoardEdgeClearance
23210
23241
  };
23211
23242
  }
23212
- function Group_getObstaclesFromRoutedTraces(traces) {
23243
+ function Group_getObstaclesFromRoutedTraces(traces, layerCount) {
23213
23244
  const obstacles = [];
23214
23245
  for (const trace of traces) {
23215
- addTraceObstacles(obstacles, trace);
23246
+ addTraceObstacles(obstacles, trace, layerCount);
23216
23247
  }
23217
23248
  return obstacles;
23218
23249
  }
@@ -24480,7 +24511,8 @@ var Group = class extends NormalComponent3 {
24480
24511
  ...Group_getObstaclesFromRoutedTraces(
24481
24512
  outputTraces.filter(
24482
24513
  (trace) => !traceMatchesRoutingPhase(trace, routingPhasePlan)
24483
- )
24514
+ ),
24515
+ baseSimpleRouteJson.layerCount
24484
24516
  )
24485
24517
  ];
24486
24518
  } else if (hasPhasedAutorouting) {
@@ -24490,7 +24522,10 @@ var Group = class extends NormalComponent3 {
24490
24522
  );
24491
24523
  simpleRouteJson.obstacles = [
24492
24524
  ...simpleRouteJson.obstacles,
24493
- ...Group_getObstaclesFromRoutedTraces(outputTraces)
24525
+ ...Group_getObstaclesFromRoutedTraces(
24526
+ outputTraces,
24527
+ baseSimpleRouteJson.layerCount
24528
+ )
24494
24529
  ];
24495
24530
  }
24496
24531
  simpleRouteJson = Group_applyDrcTolerancesToSimpleRouteJson(
@@ -27045,14 +27080,7 @@ var Board = class extends Group {
27045
27080
  * Get all available layers for the board
27046
27081
  */
27047
27082
  get allLayers() {
27048
- const layerCount = this._parsedProps.layers ?? 2;
27049
- if (layerCount === 1) {
27050
- return ["top"];
27051
- }
27052
- if (layerCount === 4) {
27053
- return ["top", "bottom", "inner1", "inner2"];
27054
- }
27055
- return ["top", "bottom"];
27083
+ return getBoardAvailableLayers(this._parsedProps.layers ?? 2);
27056
27084
  }
27057
27085
  _getSubcircuitLayerCount() {
27058
27086
  return this._parsedProps.layers ?? 2;
@@ -31235,7 +31263,7 @@ var Via = class extends PrimitiveComponent2 {
31235
31263
  };
31236
31264
  }
31237
31265
  getAvailablePcbLayers() {
31238
- return ["top", "inner1", "inner2", "bottom"];
31266
+ return this._getLayers();
31239
31267
  }
31240
31268
  _getResolvedViaDiameters(pcbStyle) {
31241
31269
  return getViaDiameterDefaultsWithOverrides(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1459",
4
+ "version": "0.0.1461",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -50,9 +50,9 @@
50
50
  "@tscircuit/math-utils": "^0.0.36",
51
51
  "@tscircuit/miniflex": "^0.0.4",
52
52
  "@tscircuit/ngspice-spice-engine": "^0.0.19",
53
- "@tscircuit/props": "^0.0.578",
53
+ "@tscircuit/props": "^0.0.583",
54
54
  "@tscircuit/schematic-match-adapt": "^0.0.18",
55
- "@tscircuit/schematic-trace-solver": "^0.0.99",
55
+ "@tscircuit/schematic-trace-solver": "^0.0.101",
56
56
  "@tscircuit/solver-utils": "^0.0.16",
57
57
  "@tscircuit/soup-util": "^0.0.41",
58
58
  "@types/bun": "^1.2.16",
@@ -64,7 +64,7 @@
64
64
  "bun-match-svg": "0.0.12",
65
65
  "calculate-elbow": "^0.0.12",
66
66
  "chokidar-cli": "^3.0.0",
67
- "circuit-json": "^0.0.447",
67
+ "circuit-json": "^0.0.450",
68
68
  "circuit-json-to-bpc": "^0.0.13",
69
69
  "circuit-json-to-connectivity-map": "^0.0.23",
70
70
  "circuit-json-to-gltf": "^0.0.105",