@tscircuit/core 0.0.1358 → 0.0.1360
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 +31 -28
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -18108,7 +18108,12 @@ var TEXT_BOX_ENABLED_FTYPES = /* @__PURE__ */ new Set([
|
|
|
18108
18108
|
"simple_crystal",
|
|
18109
18109
|
"simple_resonator",
|
|
18110
18110
|
"simple_potentiometer",
|
|
18111
|
-
"simple_fuse"
|
|
18111
|
+
"simple_fuse",
|
|
18112
|
+
"simple_diode",
|
|
18113
|
+
"simple_led",
|
|
18114
|
+
"simple_transistor",
|
|
18115
|
+
"simple_mosfet",
|
|
18116
|
+
"simple_op_amp"
|
|
18112
18117
|
]);
|
|
18113
18118
|
function getTextBounds({
|
|
18114
18119
|
text,
|
|
@@ -19940,35 +19945,33 @@ function extendTraceEndpointsToReachPinsInsideExpandedBoundingBox(params, db) {
|
|
|
19940
19945
|
usedCenters.add(i);
|
|
19941
19946
|
}
|
|
19942
19947
|
}
|
|
19943
|
-
const
|
|
19944
|
-
|
|
19945
|
-
|
|
19946
|
-
|
|
19948
|
+
const ALIGN_EPS = 1e-3;
|
|
19949
|
+
const endpoints = ["start", "end"];
|
|
19950
|
+
const candidates = [];
|
|
19951
|
+
for (const endpoint of endpoints) {
|
|
19952
|
+
const endpointPoint = endpoint === "start" ? result[0] : result[result.length - 1];
|
|
19947
19953
|
for (let i = 0; i < centers.length; i++) {
|
|
19948
19954
|
if (usedCenters.has(i)) continue;
|
|
19949
|
-
const
|
|
19950
|
-
|
|
19951
|
-
|
|
19952
|
-
|
|
19955
|
+
const center = centers[i];
|
|
19956
|
+
const dist = d2(center, endpointPoint);
|
|
19957
|
+
if (dist > MAX_PIN_SNAP_GAP ** 2) continue;
|
|
19958
|
+
if (Math.abs(center.x - endpointPoint.x) > ALIGN_EPS && Math.abs(center.y - endpointPoint.y) > ALIGN_EPS) {
|
|
19959
|
+
continue;
|
|
19953
19960
|
}
|
|
19961
|
+
candidates.push({ endpoint, centerIndex: i, dist });
|
|
19954
19962
|
}
|
|
19955
|
-
|
|
19956
|
-
|
|
19957
|
-
|
|
19958
|
-
|
|
19959
|
-
|
|
19960
|
-
|
|
19961
|
-
|
|
19962
|
-
|
|
19963
|
-
|
|
19964
|
-
|
|
19965
|
-
}
|
|
19966
|
-
|
|
19967
|
-
if (endpoint === "start") result.unshift({ x: c.x, y: c.y });
|
|
19968
|
-
else result.push({ x: c.x, y: c.y });
|
|
19969
|
-
};
|
|
19970
|
-
snap("start");
|
|
19971
|
-
snap("end");
|
|
19963
|
+
}
|
|
19964
|
+
candidates.sort((a, b) => a.dist - b.dist);
|
|
19965
|
+
const usedEndpoints = /* @__PURE__ */ new Set();
|
|
19966
|
+
for (const { endpoint, centerIndex, dist } of candidates) {
|
|
19967
|
+
if (usedEndpoints.has(endpoint) || usedCenters.has(centerIndex)) continue;
|
|
19968
|
+
usedCenters.add(centerIndex);
|
|
19969
|
+
usedEndpoints.add(endpoint);
|
|
19970
|
+
if (dist <= 1e-12) continue;
|
|
19971
|
+
const center = centers[centerIndex];
|
|
19972
|
+
if (endpoint === "start") result.unshift({ x: center.x, y: center.y });
|
|
19973
|
+
else result.push({ x: center.x, y: center.y });
|
|
19974
|
+
}
|
|
19972
19975
|
return result;
|
|
19973
19976
|
}
|
|
19974
19977
|
function applyTracesFromSolverOutput(args) {
|
|
@@ -24237,7 +24240,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
24237
24240
|
var package_default = {
|
|
24238
24241
|
name: "@tscircuit/core",
|
|
24239
24242
|
type: "module",
|
|
24240
|
-
version: "0.0.
|
|
24243
|
+
version: "0.0.1359",
|
|
24241
24244
|
types: "dist/index.d.ts",
|
|
24242
24245
|
main: "dist/index.js",
|
|
24243
24246
|
module: "dist/index.js",
|
|
@@ -24282,7 +24285,7 @@ var package_default = {
|
|
|
24282
24285
|
"@tscircuit/jlcpcb-manufacturing-specs": "git+https://github.com/tscircuit/jlcpcb-manufacturing-specs#e08af159db01a37db007e33f0a7268d0e4a279a5",
|
|
24283
24286
|
"@tscircuit/krt-wasm": "^0.1.1",
|
|
24284
24287
|
"@tscircuit/log-soup": "^1.0.2",
|
|
24285
|
-
"@tscircuit/matchpack": "",
|
|
24288
|
+
"@tscircuit/matchpack": "^0.0.29",
|
|
24286
24289
|
"@tscircuit/math-utils": "^0.0.36",
|
|
24287
24290
|
"@tscircuit/miniflex": "^0.0.4",
|
|
24288
24291
|
"@tscircuit/props": "^0.0.555",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.1360",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@tscircuit/jlcpcb-manufacturing-specs": "git+https://github.com/tscircuit/jlcpcb-manufacturing-specs#e08af159db01a37db007e33f0a7268d0e4a279a5",
|
|
47
47
|
"@tscircuit/krt-wasm": "^0.1.1",
|
|
48
48
|
"@tscircuit/log-soup": "^1.0.2",
|
|
49
|
-
"@tscircuit/matchpack": "",
|
|
49
|
+
"@tscircuit/matchpack": "^0.0.29",
|
|
50
50
|
"@tscircuit/math-utils": "^0.0.36",
|
|
51
51
|
"@tscircuit/miniflex": "^0.0.4",
|
|
52
52
|
"@tscircuit/props": "^0.0.555",
|