@tscircuit/core 0.0.387 → 0.0.388
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 -1
- package/dist/index.js +35 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import * as _tscircuit_layout from '@tscircuit/layout';
|
|
|
12
12
|
import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
|
|
13
13
|
import { GraphicsObject } from 'graphics-debug';
|
|
14
14
|
|
|
15
|
-
declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "InitializePortsFromChildren", "CreateNetsFromProps", "CreateTracesFromProps", "CreateTraceHintsFromProps", "SourceRender", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SchematicComponentRender", "SchematicPortRender", "SchematicLayout", "SchematicTraceRender", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbLayout", "PcbComponentSizeCalculation", "PcbBoardAutoSize", "
|
|
15
|
+
declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "InitializePortsFromChildren", "CreateNetsFromProps", "CreateTracesFromProps", "CreateTraceHintsFromProps", "SourceRender", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SchematicComponentRender", "SchematicPortRender", "SchematicLayout", "SchematicTraceRender", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbLayout", "PcbComponentSizeCalculation", "PcbBoardAutoSize", "PcbTraceHintRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbDesignRuleChecks", "CadModelRender", "PartsEngineRender"];
|
|
16
16
|
type RenderPhase = (typeof orderedRenderPhases)[number];
|
|
17
17
|
type RenderPhaseFn<K extends RenderPhase = RenderPhase> = `doInitial${K}` | `update${K}` | `remove${K}`;
|
|
18
18
|
type RenderPhaseStates = Record<RenderPhase, {
|
package/dist/index.js
CHANGED
|
@@ -94,8 +94,8 @@ var orderedRenderPhases = [
|
|
|
94
94
|
"PcbLayout",
|
|
95
95
|
"PcbComponentSizeCalculation",
|
|
96
96
|
"PcbBoardAutoSize",
|
|
97
|
-
"PcbTraceRender",
|
|
98
97
|
"PcbTraceHintRender",
|
|
98
|
+
"PcbTraceRender",
|
|
99
99
|
"PcbRouteNetIslands",
|
|
100
100
|
"PcbDesignRuleChecks",
|
|
101
101
|
"CadModelRender",
|
|
@@ -3769,7 +3769,7 @@ var createSchematicTraceJunctions = ({
|
|
|
3769
3769
|
return [];
|
|
3770
3770
|
};
|
|
3771
3771
|
|
|
3772
|
-
// lib/components/primitive-components/Trace/get-max-length-from-
|
|
3772
|
+
// lib/components/primitive-components/Trace/get-max-length-from-connected-capacitors.ts
|
|
3773
3773
|
var getMaxLengthFromConnectedCapacitors = (ports, { db }) => {
|
|
3774
3774
|
const capacitorMaxLengths = ports.map((port) => {
|
|
3775
3775
|
const sourcePort = db.source_port.get(port.source_port_id);
|
|
@@ -6001,6 +6001,7 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
6001
6001
|
if (!db) {
|
|
6002
6002
|
throw new Error("db or circuitJson is required");
|
|
6003
6003
|
}
|
|
6004
|
+
const traceHints = db.pcb_trace_hint.list();
|
|
6004
6005
|
const relevantSubcircuitIds = subcircuit_id ? /* @__PURE__ */ new Set([subcircuit_id]) : null;
|
|
6005
6006
|
if (subcircuit_id) {
|
|
6006
6007
|
const descendantSubcircuitIds = getDescendantSubcircuitIds(
|
|
@@ -6073,16 +6074,40 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
6073
6074
|
};
|
|
6074
6075
|
});
|
|
6075
6076
|
if (connectedPorts.length < 2) return null;
|
|
6077
|
+
const [portA, portB] = connectedPorts;
|
|
6078
|
+
const layerA = portA.layers?.[0] ?? "top";
|
|
6079
|
+
const layerB = portB.layers?.[0] ?? "top";
|
|
6080
|
+
const matchingHints = traceHints.filter(
|
|
6081
|
+
(hint) => hint.pcb_port_id === portA.pcb_port_id || hint.pcb_port_id === portB.pcb_port_id
|
|
6082
|
+
);
|
|
6083
|
+
const hintPoints = [];
|
|
6084
|
+
for (const hint of matchingHints) {
|
|
6085
|
+
const port = db.pcb_port.get(hint.pcb_port_id);
|
|
6086
|
+
const layer = port?.layers?.[0] ?? "top";
|
|
6087
|
+
for (const pt of hint.route) {
|
|
6088
|
+
hintPoints.push({
|
|
6089
|
+
x: pt.x,
|
|
6090
|
+
y: pt.y,
|
|
6091
|
+
layer
|
|
6092
|
+
});
|
|
6093
|
+
}
|
|
6094
|
+
}
|
|
6076
6095
|
return {
|
|
6077
6096
|
name: trace.source_trace_id ?? connMap.getNetConnectedToId(trace.source_trace_id) ?? "",
|
|
6078
6097
|
source_trace_id: trace.source_trace_id,
|
|
6079
|
-
pointsToConnect:
|
|
6080
|
-
|
|
6081
|
-
x:
|
|
6082
|
-
y:
|
|
6083
|
-
layer:
|
|
6084
|
-
}
|
|
6085
|
-
|
|
6098
|
+
pointsToConnect: [
|
|
6099
|
+
{
|
|
6100
|
+
x: portA.x,
|
|
6101
|
+
y: portA.y,
|
|
6102
|
+
layer: layerA
|
|
6103
|
+
},
|
|
6104
|
+
...hintPoints,
|
|
6105
|
+
{
|
|
6106
|
+
x: portB.x,
|
|
6107
|
+
y: portB.y,
|
|
6108
|
+
layer: layerB
|
|
6109
|
+
}
|
|
6110
|
+
]
|
|
6086
6111
|
};
|
|
6087
6112
|
}).filter((c) => c !== null);
|
|
6088
6113
|
const source_nets = db.source_net.list().filter(
|
|
@@ -7891,7 +7916,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
7891
7916
|
var package_default = {
|
|
7892
7917
|
name: "@tscircuit/core",
|
|
7893
7918
|
type: "module",
|
|
7894
|
-
version: "0.0.
|
|
7919
|
+
version: "0.0.387",
|
|
7895
7920
|
types: "dist/index.d.ts",
|
|
7896
7921
|
main: "dist/index.js",
|
|
7897
7922
|
module: "dist/index.js",
|