Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,6 @@ export class OuterLayerContainmentMergeSolver extends BaseSolver {
const viaMinSize = Math.max(srj.minViaDiameter ?? 0, srj.minTraceWidth || 0)
const originalNodes = this.input.meshNodes.map(cloneNode)
const obstaclesByLayer = this.buildObstaclesByLayer(layerCount)
if (
!obstaclesByLayer
.slice(1, -1)
.some((entries) => entries.some((entry) => entry.obstacle.isCopperPour))
) {
return originalNodes
}
const mutableOuterNodes = originalNodes.filter(
(node) =>
isFreeNode(node) &&
Expand Down Expand Up @@ -312,17 +305,16 @@ export class OuterLayerContainmentMergeSolver extends BaseSolver {
fromZ: number
toZ: number
obstaclesByLayer: ObstacleWithRect[][]
}) {
}): boolean {
const { rect, fromZ, toZ, obstaclesByLayer } = params
const lo = Math.min(fromZ, toZ)
const hi = Math.max(fromZ, toZ)
const firstZ = Math.min(fromZ, toZ)
const lastZ = Math.max(fromZ, toZ)

if (hi - lo < 2) return false
if (lastZ - firstZ < 2) return false

// This merge reconnects outer regions separated by copper planes. Empty
// inner layers permit transit, but do not require a containment merge.
let crossesCopperPlane = false
for (let z = lo + 1; z < hi; z++) {
// Empty inner layers permit a through-via. An inner copper pour also permits
// transit when it covers the whole region, while ordinary obstacles do not.
for (let z = firstZ + 1; z < lastZ; z++) {
const overlapping = (obstaclesByLayer[z] ?? []).filter((entry) =>
overlaps(entry.rect, rect),
)
Expand All @@ -339,10 +331,9 @@ export class OuterLayerContainmentMergeSolver extends BaseSolver {
) {
return false
}
crossesCopperPlane = true
}

return crossesCopperPlane
return true
}

override getOutput(): { outputNodes: CapacityMeshNode[] } {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 0 additions & 54 deletions tests/solver/outer-layer-transit-requires-inner-copper.test.ts

This file was deleted.

51 changes: 51 additions & 0 deletions tests/solver/outer-layer-transit-without-inner-obstacles.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { expect, test } from "bun:test"
import { OuterLayerContainmentMergeSolver } from "lib/solvers/OuterLayerContainmentMergeSolver/OuterLayerContainmentMergeSolver"
import type { CapacityMeshNode } from "lib/types/capacity-mesh-types"

test("outer layers connect through empty inner layers", (): void => {
const meshNodes: CapacityMeshNode[] = [
{
capacityMeshNodeId: "top",
center: { x: 0, y: 0 },
width: 2,
height: 2,
layer: "z0",
availableZ: [0],
},
{
capacityMeshNodeId: "bottom",
center: { x: 0, y: 0 },
width: 4,
height: 4,
layer: "z3",
availableZ: [3],
},
]
const solver = new OuterLayerContainmentMergeSolver({
meshNodes,
simpleRouteJson: {
layerCount: 4,
bounds: { minX: -2, maxX: 2, minY: -2, maxY: 2 },
minTraceWidth: 0.08,
minViaDiameter: 0.45,
obstacles: [],
connections: [],
},
zIndexByName: new Map([
["top", 0],
["inner1", 1],
["inner2", 2],
["bottom", 3],
]),
})

solver.solve()

expect(
solver
.getOutput()
.outputNodes.find((node) => node.capacityMeshNodeId === "top")
?.availableZ,
).toEqual([0, 3])
expect(meshNodes.map((node) => node.availableZ)).toEqual([[0], [3]])
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ test("PMP22650 has a local top-to-bottom routing region near C241 and R188", asy
),
)

expect(closestTopBottomTransitionDistance).toBeGreaterThan(5)
expect(closestTopBottomTransitionDistance).toBeLessThan(1.5)

const topObstacles = getLocalObstacleRects(rectDiffSample024.obstacles, "top")
const bottomObstacles = getLocalObstacleRects(
Expand Down
Loading