Skip to content
Closed
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
2 changes: 2 additions & 0 deletions lib/RectDiffPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ export class RectDiffPipeline extends BasePipelineSolver<RectDiffPipelineInput>
rectDiffPipeline.inputProblem.simpleRouteJson.layerCount || 0,
},
maxGapFillPasses: rectDiffPipeline.inputProblem.maxGapFillPasses,
minTraceWidth:
rectDiffPipeline.inputProblem.simpleRouteJson.minTraceWidth,
},
],
),
Expand Down
11 changes: 6 additions & 5 deletions lib/solvers/GapFillSolver/ExpandEdgesToEmptySpaceSolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const getDistanceToBoardEdge = (
export type ExpandEdgesToEmptySpaceSolverInput = {
/** Optional for standalone callers; the full board pipeline always supplies it. */
bounds?: Bounds
minTraceWidth?: number
inputMeshNodes: CapacityMeshNode[]
segmentsWithAdjacentEmptySpace: Array<SegmentWithAdjacentEmptySpace>
boardVoid?: {
Expand Down Expand Up @@ -261,6 +262,11 @@ export class ExpandEdgesToEmptySpaceSolver extends BaseSolver {
const nodeWidth = nodeBounds.maxX - nodeBounds.minX
const nodeHeight = nodeBounds.maxY - nodeBounds.minY

const minRoutableDimension = Math.max(EPS, this.input.minTraceWidth ?? 0)
if (nodeWidth < minRoutableDimension || nodeHeight < minRoutableDimension) {
return
}

const expandedSegment = {
segment,
newNode: {
Expand All @@ -274,11 +280,6 @@ export class ExpandEdgesToEmptySpaceSolver extends BaseSolver {
}
this.lastExpandedSegment = expandedSegment

if (nodeWidth < EPS || nodeHeight < EPS) {
// Node is too small, skipping
return
}

this.expandedSegments.push(expandedSegment)
this.rectSpatialIndex.insert({
...expandedSegment.newNode,
Expand Down
2 changes: 2 additions & 0 deletions lib/solvers/GapFillSolver/GapFillSolverPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type GapFillSolverInput = {
* expanded nodes; values below 1 are clamped to 1.
*/
maxGapFillPasses: number
minTraceWidth: number
}

type GapFillOutput = {
Expand Down Expand Up @@ -75,6 +76,7 @@ export class GapFillSolverPipeline extends BasePipelineSolver<GapFillSolverInput
.segmentsWithAdjacentEmptySpace,
boardVoid: gapFillPipeline.inputProblem.boardVoid,
bounds: gapFillPipeline.inputProblem.bounds,
minTraceWidth: gapFillPipeline.inputProblem.minTraceWidth,
},
],
{
Expand Down
1 change: 1 addition & 0 deletions tests/gap-fill-board-bounds.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ test("bounded recursive gap filling keeps useful space and respects blockers", (
bounds,
meshNodes: [parent, blocker],
maxGapFillPasses: 3,
minTraceWidth: 0.1,
})
solver.solve()
const generated = solver
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24,480 changes: 11,916 additions & 12,564 deletions .../bugreport37-srj18-sample002/__snapshots__/bugreport37-srj18-sample002.snap.svg
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.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const platedHoleRegion: CapacityMeshNode = {

test("PMP22650 does not fill a gap narrower than minTraceWidth", async () => {
const solver = new ExpandEdgesToEmptySpaceSolver({
minTraceWidth: 0.1,
inputMeshNodes: [lowerRegion, upperRegion, platedHoleRegion],
segmentsWithAdjacentEmptySpace: [
{
Expand All @@ -51,11 +52,7 @@ test("PMP22650 does not fill a gap narrower than minTraceWidth", async () => {
const expandedNodes = solver
.getOutput()
.expandedSegments.map(({ newNode }) => newNode)
expect(expandedNodes).toHaveLength(1)
expect(expandedNodes[0]).toMatchObject({
width: 5.059939270000001,
height: 0.002759999999966567,
})
expect(expandedNodes).toHaveLength(0)
const verticalScale = 40
await expect(
getSvgFromGraphicsObject(
Expand Down

Large diffs are not rendered by default.

Loading