@tscircuit/core 0.0.2172 → 0.0.2173
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 +1 -0
- package/dist/index.js +38 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -110860,6 +110860,7 @@ declare const pcbTraceProps: z.ZodObject<{
|
|
|
110860
110860
|
}>;
|
|
110861
110861
|
declare class PcbTrace extends PrimitiveComponent<typeof pcbTraceProps> {
|
|
110862
110862
|
pcb_trace_id: string | null;
|
|
110863
|
+
_materializedRouteViaIndices: Set<number>;
|
|
110863
110864
|
isAntennaTrace: boolean;
|
|
110864
110865
|
isPcbPrimitive: boolean;
|
|
110865
110866
|
get config(): {
|
package/dist/index.js
CHANGED
|
@@ -11582,6 +11582,8 @@ var pcbTraceProps = z7.object({
|
|
|
11582
11582
|
});
|
|
11583
11583
|
var PcbTrace = class extends PrimitiveComponent2 {
|
|
11584
11584
|
pcb_trace_id = null;
|
|
11585
|
+
// Imported footprints can already supply the physical via as a pcb_via.
|
|
11586
|
+
_materializedRouteViaIndices = /* @__PURE__ */ new Set();
|
|
11585
11587
|
// Marks radiating copper created by Antenna, never its feed connection.
|
|
11586
11588
|
isAntennaTrace = false;
|
|
11587
11589
|
isPcbPrimitive = true;
|
|
@@ -11638,6 +11640,31 @@ var PcbTrace = class extends PrimitiveComponent2 {
|
|
|
11638
11640
|
pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
|
|
11639
11641
|
});
|
|
11640
11642
|
this.pcb_trace_id = pcb_trace.pcb_trace_id;
|
|
11643
|
+
const { holeDiameter, padDiameter } = getViaDiameterDefaults(
|
|
11644
|
+
this.getInheritedMergedProperty("pcbStyle")
|
|
11645
|
+
);
|
|
11646
|
+
for (const [routeIndex, point6] of transformedRoute.entries()) {
|
|
11647
|
+
if (point6.route_type !== "via") continue;
|
|
11648
|
+
if (this._materializedRouteViaIndices.has(routeIndex)) continue;
|
|
11649
|
+
db2.pcb_via.insert({
|
|
11650
|
+
pcb_trace_id: pcb_trace.pcb_trace_id,
|
|
11651
|
+
x: point6.x,
|
|
11652
|
+
y: point6.y,
|
|
11653
|
+
hole_diameter: point6.hole_diameter ?? holeDiameter,
|
|
11654
|
+
outer_diameter: point6.outer_diameter ?? padDiameter,
|
|
11655
|
+
layers: getViaSpanLayers({
|
|
11656
|
+
fromLayer: point6.from_layer,
|
|
11657
|
+
toLayer: point6.to_layer,
|
|
11658
|
+
layerCount: subcircuit._getSubcircuitLayerCount()
|
|
11659
|
+
}),
|
|
11660
|
+
from_layer: point6.from_layer,
|
|
11661
|
+
to_layer: point6.to_layer,
|
|
11662
|
+
tented_on_top: point6.tented_on_top,
|
|
11663
|
+
tented_on_bottom: point6.tented_on_bottom,
|
|
11664
|
+
subcircuit_id: pcb_trace.subcircuit_id,
|
|
11665
|
+
pcb_group_id: pcb_trace.pcb_group_id
|
|
11666
|
+
});
|
|
11667
|
+
}
|
|
11641
11668
|
}
|
|
11642
11669
|
getPcbSize() {
|
|
11643
11670
|
const bounds = this._getPcbLocalBoundsBeforeLayout();
|
|
@@ -14745,11 +14772,16 @@ var createComponentsFromCircuitJson = ({
|
|
|
14745
14772
|
components.push(silkscreenText);
|
|
14746
14773
|
}
|
|
14747
14774
|
} else if (elm.type === "pcb_trace") {
|
|
14748
|
-
|
|
14749
|
-
|
|
14750
|
-
|
|
14751
|
-
|
|
14752
|
-
|
|
14775
|
+
const pcbTrace = new PcbTrace({ route: elm.route });
|
|
14776
|
+
for (const [routeIndex, point6] of elm.route.entries()) {
|
|
14777
|
+
if (point6.route_type !== "via") continue;
|
|
14778
|
+
if (circuitJson.some(
|
|
14779
|
+
(via) => via.type === "pcb_via" && via.x === point6.x && via.y === point6.y && via.layers.includes(point6.from_layer) && via.layers.includes(point6.to_layer)
|
|
14780
|
+
)) {
|
|
14781
|
+
pcbTrace._materializedRouteViaIndices.add(routeIndex);
|
|
14782
|
+
}
|
|
14783
|
+
}
|
|
14784
|
+
components.push(pcbTrace);
|
|
14753
14785
|
} else if (elm.type === "pcb_via") {
|
|
14754
14786
|
const via = pcb_via2.parse(elm);
|
|
14755
14787
|
const layers = elm.layers ?? [];
|
|
@@ -119498,7 +119530,7 @@ var RoutingPhasePreparationError = class extends Error {
|
|
|
119498
119530
|
var package_default = {
|
|
119499
119531
|
name: "@tscircuit/core",
|
|
119500
119532
|
type: "module",
|
|
119501
|
-
version: "0.0.
|
|
119533
|
+
version: "0.0.2172",
|
|
119502
119534
|
types: "dist/index.d.ts",
|
|
119503
119535
|
main: "dist/index.js",
|
|
119504
119536
|
module: "dist/index.js",
|