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
7 changes: 7 additions & 0 deletions lib/solvers/AutoroutingPipelineSolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import { StrawSolver } from "./StrawSolver/StrawSolver"
import { SingleLayerNodeMergerSolver } from "./SingleLayerNodeMerger/SingleLayerNodeMergerSolver"
import { CapacityNodeTargetMerger2 } from "./CapacityNodeTargetMerger/CapacityNodeTargetMerger2"
import { PathSmoothingSolver } from "./PathSmoothingSolver/PathSmoothingSolver"

interface CapacityMeshSolverOptions {
capacityDepth?: number
Expand Down Expand Up @@ -83,6 +84,7 @@
colorMap: Record<string, string>
segmentToPointSolver?: CapacitySegmentToPointSolver
unravelMultiSectionSolver?: UnravelMultiSectionSolver
pathSmoothingSolver?: PathSmoothingSolver
segmentToPointOptimizer?: CapacitySegmentPointOptimizer
highDensityRouteSolver?: HighDensitySolver
highDensityStitchSolver?: MultipleHighDensityRouteStitchSolver
Expand Down Expand Up @@ -241,6 +243,9 @@
},
],
),
definePipelineStep("pathSmoothingSolver", PathSmoothingSolver, (cms) => [
{},
]),
]

constructor(
Expand Down Expand Up @@ -327,6 +332,7 @@
this.segmentToPointOptimizer?.visualize()
const highDensityViz = this.highDensityRouteSolver?.visualize()
const highDensityStitchViz = this.highDensityStitchSolver?.visualize()
const pathSmoothingViz = this.pathSmoothingSolver?.visualize()
const problemViz = {
points: [...this.srj.connections.flatMap((c) => c.pointsToConnect)],
rects: [
Expand Down Expand Up @@ -379,6 +385,7 @@
convertSrjToGraphicsObject(this.getOutputSimpleRouteJson()),
)
: null,
pathSmoothingViz,
].filter(Boolean) as GraphicsObject[]
// return visualizations[visualizations.length - 1]
return combineVisualizations(...visualizations)
Expand All @@ -400,7 +407,7 @@
*/
getOutputSimplifiedPcbTraces(): SimplifiedPcbTraces {
if (!this.solved || !this.highDensityRouteSolver) {
throw new Error("Cannot get output before solving is complete")

Check failure on line 410 in lib/solvers/AutoroutingPipelineSolver.ts

View workflow job for this annotation

GitHub Actions / test

error: Cannot get output before solving is complete

at getOutputSimplifiedPcbTraces (/home/runner/work/capacity-autorouter/capacity-autorouter/lib/solvers/AutoroutingPipelineSolver.ts:410:13) at getOutputSimpleRouteJson (/home/runner/work/capacity-autorouter/capacity-autorouter/lib/solvers/AutoroutingPipelineSolver.ts:444:20) at <anonymous> (/home/runner/work/capacity-autorouter/capacity-autorouter/tests/e2e2.test.ts:101:27)
}

const traces: SimplifiedPcbTraces = []
Expand Down
10 changes: 10 additions & 0 deletions lib/solvers/PathSmoothingSolver/PathSmoothingSolver.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { GraphicsObject } from "graphics-debug"
import { BaseSolver } from "../BaseSolver"

export class PathSmoothingSolver extends BaseSolver {
constructor(params: {}) {
super()
}

visualize(): GraphicsObject {}
}
Loading