@tscircuit/core 0.0.1899 → 0.0.1900

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 CHANGED
@@ -4988,7 +4988,7 @@ var Via = class extends PrimitiveComponent2 {
4988
4988
  const connectedNetOrTrace = this._getConnectedNetOrTrace();
4989
4989
  const sourceTraceId = this.source_trace_id ?? (connectedNetOrTrace instanceof Net ? void 0 : connectedNetOrTrace?.source_trace_id);
4990
4990
  const sourceNetId = !sourceTraceId && connectedNetOrTrace instanceof Net ? connectedNetOrTrace.source_net_id : void 0;
4991
- const pcb_via = db.pcb_via.insert({
4991
+ const pcb_via3 = db.pcb_via.insert({
4992
4992
  x: position.x,
4993
4993
  y: position.y,
4994
4994
  hole_diameter: holeDiameter,
@@ -5003,7 +5003,7 @@ var Via = class extends PrimitiveComponent2 {
5003
5003
  ...sourceTraceId ? { source_trace_id: sourceTraceId } : {},
5004
5004
  ...sourceNetId ? { source_net_id: sourceNetId } : {}
5005
5005
  });
5006
- this.pcb_via_id = pcb_via.pcb_via_id;
5006
+ this.pcb_via_id = pcb_via3.pcb_via_id;
5007
5007
  }
5008
5008
  };
5009
5009
 
@@ -5185,6 +5185,11 @@ function Trace__findConnectedPorts(trace) {
5185
5185
  };
5186
5186
  }
5187
5187
 
5188
+ // lib/components/primitive-components/Trace/Trace_doInitialPcbManualTraceRender.ts
5189
+ import {
5190
+ pcb_via
5191
+ } from "circuit-json";
5192
+
5188
5193
  // lib/components/primitive-components/Trace/trace-utils/compute-trace-length.ts
5189
5194
  function getTraceLength(route) {
5190
5195
  let totalLength = 0;
@@ -5495,7 +5500,7 @@ function Trace_doInitialPcbManualTraceRender(trace) {
5495
5500
  }
5496
5501
  const width = trace._getExplicitTraceThickness() ?? trace.getSubcircuit()._parsedProps.minTraceWidth ?? jlcMinTolerances.min_trace_width;
5497
5502
  if (inflatedPcbTraces.length > 0) {
5498
- const { maybeFlipLayer } = trace._getPcbPrimitiveFlippedHelpers();
5503
+ const { isFlipped, maybeFlipLayer } = trace._getPcbPrimitiveFlippedHelpers();
5499
5504
  const transform2 = trace._computePcbGlobalTransformBeforeLayout();
5500
5505
  const insertedRoutes = [];
5501
5506
  const subcircuitConnectivityMapKey2 = trace.subcircuit_connectivity_map_key ?? db.source_trace.get(trace.source_trace_id)?.subcircuit_connectivity_map_key;
@@ -5541,10 +5546,11 @@ function Trace_doInitialPcbManualTraceRender(trace) {
5541
5546
  const point6 = transformedRoute[index];
5542
5547
  if (point6.route_type === "via") {
5543
5548
  const originalPoint = inflatedPcbTrace.route[index];
5544
- const inflatedPcbVia = findInflatedPcbViaForPoint(
5549
+ const originalPcbVia = findInflatedPcbViaForPoint(
5545
5550
  trace._inflatedPcbVias,
5546
5551
  originalPoint
5547
5552
  );
5553
+ const inflatedPcbVia = originalPcbVia ? pcb_via.parse(originalPcbVia) : void 0;
5548
5554
  const routePointViaDiameter = getViaDiameterFromRoutePoint(point6);
5549
5555
  const fromLayer = maybeFlipLayer(
5550
5556
  inflatedPcbVia?.from_layer ?? point6.from_layer
@@ -5571,7 +5577,9 @@ function Trace_doInitialPcbManualTraceRender(trace) {
5571
5577
  subcircuit_connectivity_map_key: inflatedPcbVia?.subcircuit_connectivity_map_key ?? subcircuitConnectivityMapKey2,
5572
5578
  net_is_assignable: inflatedPcbVia?.net_is_assignable,
5573
5579
  net_assigned: inflatedPcbVia?.net_assigned,
5574
- is_tented: inflatedPcbVia?.is_tented
5580
+ // Use the same footprint flip as the route and via layers above.
5581
+ tented_on_top: isFlipped ? inflatedPcbVia?.tented_on_bottom : inflatedPcbVia?.tented_on_top,
5582
+ tented_on_bottom: isFlipped ? inflatedPcbVia?.tented_on_top : inflatedPcbVia?.tented_on_bottom
5575
5583
  });
5576
5584
  }
5577
5585
  }
@@ -8003,6 +8011,9 @@ var underscorifyPortArrangement = (portArrangement) => {
8003
8011
 
8004
8012
  // lib/utils/createComponentsFromCircuitJson.ts
8005
8013
  import { getUnitVectorFromDirection as getUnitVectorFromDirection2 } from "@tscircuit/math-utils";
8014
+ import {
8015
+ pcb_via as pcb_via2
8016
+ } from "circuit-json";
8006
8017
 
8007
8018
  // lib/utils/normalizeTextForCircuitJson.ts
8008
8019
  function normalizeTextForCircuitJson(text) {
@@ -9455,7 +9466,10 @@ import {
9455
9466
  import { z as z8 } from "zod";
9456
9467
  var pcbViaProps = viaProps2.extend({
9457
9468
  layers: z8.array(layer_ref).optional(),
9458
- isTented: z8.boolean().optional()
9469
+ /** @deprecated Use tentedOnTop and tentedOnBottom instead. */
9470
+ isTented: z8.boolean().optional(),
9471
+ tentedOnTop: z8.boolean().optional(),
9472
+ tentedOnBottom: z8.boolean().optional()
9459
9473
  }).partial({
9460
9474
  fromLayer: true,
9461
9475
  toLayer: true
@@ -9514,10 +9528,17 @@ var PcbVia = class extends PrimitiveComponent2 {
9514
9528
  doInitialPcbPrimitiveRender() {
9515
9529
  if (this.root?.pcbDisabled) return;
9516
9530
  const { db } = this.root;
9517
- const { holeDiameter, outerDiameter, netIsAssignable, isTented } = this._parsedProps;
9531
+ const {
9532
+ holeDiameter,
9533
+ outerDiameter,
9534
+ netIsAssignable,
9535
+ isTented,
9536
+ tentedOnTop,
9537
+ tentedOnBottom
9538
+ } = this._parsedProps;
9518
9539
  const subcircuit = this.getSubcircuit();
9519
9540
  const position = this._getGlobalPcbPositionBeforeLayout();
9520
- const { maybeFlipLayer } = this._getPcbPrimitiveFlippedHelpers();
9541
+ const { isFlipped, maybeFlipLayer } = this._getPcbPrimitiveFlippedHelpers();
9521
9542
  const layers = this._getLayers().map(
9522
9543
  (layer) => maybeFlipLayer(layer)
9523
9544
  );
@@ -9535,7 +9556,9 @@ var PcbVia = class extends PrimitiveComponent2 {
9535
9556
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
9536
9557
  pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0,
9537
9558
  net_is_assignable: netIsAssignable,
9538
- is_tented: isTented
9559
+ // Use the same footprint flip as the via layers above.
9560
+ tented_on_top: (isFlipped ? tentedOnBottom : tentedOnTop) ?? isTented,
9561
+ tented_on_bottom: (isFlipped ? tentedOnTop : tentedOnBottom) ?? isTented
9539
9562
  });
9540
9563
  this.pcb_via_id = pcbVia.pcb_via_id;
9541
9564
  }
@@ -12028,6 +12051,7 @@ var createComponentsFromCircuitJson = ({
12028
12051
  })
12029
12052
  );
12030
12053
  } else if (elm.type === "pcb_via") {
12054
+ const via = pcb_via2.parse(elm);
12031
12055
  const layers = elm.layers ?? [];
12032
12056
  const pcbVia = new PcbVia({
12033
12057
  pcbX: elm.x,
@@ -12038,7 +12062,8 @@ var createComponentsFromCircuitJson = ({
12038
12062
  toLayer: elm.to_layer ?? layers[layers.length - 1],
12039
12063
  layers,
12040
12064
  netIsAssignable: elm.net_is_assignable,
12041
- isTented: elm.is_tented
12065
+ tentedOnTop: via.tented_on_top,
12066
+ tentedOnBottom: via.tented_on_bottom
12042
12067
  });
12043
12068
  pcbVia._importedPcbTraceId = elm.pcb_trace_id;
12044
12069
  components.push(pcbVia);
@@ -61808,7 +61833,7 @@ function Group_getRoutingPhasePlans(group) {
61808
61833
  var package_default = {
61809
61834
  name: "@tscircuit/core",
61810
61835
  type: "module",
61811
- version: "0.0.1898",
61836
+ version: "0.0.1899",
61812
61837
  types: "dist/index.d.ts",
61813
61838
  main: "dist/index.js",
61814
61839
  module: "dist/index.js",
@@ -61861,7 +61886,7 @@ var package_default = {
61861
61886
  "@tscircuit/math-utils": "^0.0.36",
61862
61887
  "@tscircuit/miniflex": "^0.0.4",
61863
61888
  "@tscircuit/ngspice-spice-engine": "^0.0.20",
61864
- "@tscircuit/props": "^0.0.649",
61889
+ "@tscircuit/props": "^0.0.653",
61865
61890
  "@tscircuit/schematic-match-adapt": "^0.0.18",
61866
61891
  "@tscircuit/schematic-trace-solver": "^0.0.191",
61867
61892
  "@tscircuit/solver-utils": "^0.0.16",
@@ -61877,7 +61902,7 @@ var package_default = {
61877
61902
  "bun-match-svg": "0.0.12",
61878
61903
  "calculate-elbow": "^0.0.12",
61879
61904
  "chokidar-cli": "^3.0.0",
61880
- "circuit-json": "^0.0.484",
61905
+ "circuit-json": "^0.0.487",
61881
61906
  "circuit-json-to-bpc": "^0.0.13",
61882
61907
  "circuit-json-to-connectivity-map": "^0.0.30",
61883
61908
  "circuit-json-to-gltf": "^0.0.124",
@@ -61940,8 +61965,8 @@ var package_default = {
61940
61965
  },
61941
61966
  overrides: {
61942
61967
  "@tscircuit/circuit-json-util": "^0.0.113",
61943
- "@tscircuit/props": "^0.0.649",
61944
- "circuit-json": "^0.0.484"
61968
+ "@tscircuit/props": "^0.0.653",
61969
+ "circuit-json": "^0.0.487"
61945
61970
  }
61946
61971
  };
61947
61972
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1899",
4
+ "version": "0.0.1900",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -54,7 +54,7 @@
54
54
  "@tscircuit/math-utils": "^0.0.36",
55
55
  "@tscircuit/miniflex": "^0.0.4",
56
56
  "@tscircuit/ngspice-spice-engine": "^0.0.20",
57
- "@tscircuit/props": "^0.0.649",
57
+ "@tscircuit/props": "^0.0.653",
58
58
  "@tscircuit/schematic-match-adapt": "^0.0.18",
59
59
  "@tscircuit/schematic-trace-solver": "^0.0.191",
60
60
  "@tscircuit/solver-utils": "^0.0.16",
@@ -70,7 +70,7 @@
70
70
  "bun-match-svg": "0.0.12",
71
71
  "calculate-elbow": "^0.0.12",
72
72
  "chokidar-cli": "^3.0.0",
73
- "circuit-json": "^0.0.484",
73
+ "circuit-json": "^0.0.487",
74
74
  "circuit-json-to-bpc": "^0.0.13",
75
75
  "circuit-json-to-connectivity-map": "^0.0.30",
76
76
  "circuit-json-to-gltf": "^0.0.124",
@@ -133,7 +133,7 @@
133
133
  },
134
134
  "overrides": {
135
135
  "@tscircuit/circuit-json-util": "^0.0.113",
136
- "@tscircuit/props": "^0.0.649",
137
- "circuit-json": "^0.0.484"
136
+ "@tscircuit/props": "^0.0.653",
137
+ "circuit-json": "^0.0.487"
138
138
  }
139
139
  }