@tscircuit/core 0.0.2155 → 0.0.2157
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 +21 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4284,18 +4284,24 @@ var getObstaclesFromCircuitJson = (circuitJson, connMap) => {
|
|
|
4284
4284
|
connectedTo: withNetId([element.pcb_plated_hole_id])
|
|
4285
4285
|
});
|
|
4286
4286
|
} else if (element.shape === "oval") {
|
|
4287
|
+
const rotatedRect = {
|
|
4288
|
+
center: { x: element.x, y: element.y },
|
|
4289
|
+
width: element.outer_width,
|
|
4290
|
+
height: element.outer_height,
|
|
4291
|
+
rotation: element.ccw_rotation ?? 0
|
|
4292
|
+
};
|
|
4293
|
+
const axisAlignedRect = getAxisAlignedRectFromRotatedRect(rotatedRect);
|
|
4294
|
+
const rect = axisAlignedRect ?? rotatedRect;
|
|
4287
4295
|
obstacles.push({
|
|
4288
4296
|
circuitJsonMetadata: pcbPlatedHoleCircuitJsonMetadata,
|
|
4289
4297
|
componentId: pcbComponentId,
|
|
4290
4298
|
// @ts-ignore
|
|
4291
4299
|
type: "oval",
|
|
4292
4300
|
layers: everyLayer,
|
|
4293
|
-
center:
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
width: element.outer_width,
|
|
4298
|
-
height: element.outer_height,
|
|
4301
|
+
center: rect.center,
|
|
4302
|
+
width: rect.width,
|
|
4303
|
+
height: rect.height,
|
|
4304
|
+
ccwRotationDegrees: axisAlignedRect ? void 0 : rotatedRect.rotation,
|
|
4299
4305
|
connectedTo: withNetId([element.pcb_plated_hole_id])
|
|
4300
4306
|
});
|
|
4301
4307
|
} else if (element.shape === "pill") {
|
|
@@ -119167,7 +119173,7 @@ var RoutingPhasePreparationError = class extends Error {
|
|
|
119167
119173
|
var package_default = {
|
|
119168
119174
|
name: "@tscircuit/core",
|
|
119169
119175
|
type: "module",
|
|
119170
|
-
version: "0.0.
|
|
119176
|
+
version: "0.0.2156",
|
|
119171
119177
|
types: "dist/index.d.ts",
|
|
119172
119178
|
main: "dist/index.js",
|
|
119173
119179
|
module: "dist/index.js",
|
|
@@ -119974,14 +119980,21 @@ function getEndpointSourcePortIdsFromGeometry(db2, trace) {
|
|
|
119974
119980
|
(point6) => Boolean(point6) && point6.route_type === "wire" && point6.x !== void 0 && point6.y !== void 0
|
|
119975
119981
|
);
|
|
119976
119982
|
for (const endpoint of endpoints) {
|
|
119983
|
+
const exactEndpointSourcePortIds = /* @__PURE__ */ new Set();
|
|
119977
119984
|
for (const pcbPort of db2.pcb_port.list()) {
|
|
119978
119985
|
if (!pcbPort.source_port_id) continue;
|
|
119979
119986
|
if (endpoint.layer && pcbPort.layers && !pcbPort.layers.includes(endpoint.layer))
|
|
119980
119987
|
continue;
|
|
119981
119988
|
if (distance18(endpoint, pcbPort) <= 0.01) {
|
|
119982
|
-
|
|
119989
|
+
exactEndpointSourcePortIds.add(pcbPort.source_port_id);
|
|
119983
119990
|
}
|
|
119984
119991
|
}
|
|
119992
|
+
if (exactEndpointSourcePortIds.size > 0) {
|
|
119993
|
+
for (const sourcePortId of exactEndpointSourcePortIds) {
|
|
119994
|
+
sourcePortIds.add(sourcePortId);
|
|
119995
|
+
}
|
|
119996
|
+
continue;
|
|
119997
|
+
}
|
|
119985
119998
|
for (const smtpad of db2.pcb_smtpad.list()) {
|
|
119986
119999
|
if (!smtpad.pcb_port_id) continue;
|
|
119987
120000
|
if (endpoint.layer && smtpad.layer !== endpoint.layer) continue;
|