Skip to content

Conversation

gpeairs
Copy link
Member

@gpeairs gpeairs commented Jul 26, 2025

This is just a demo. I suspect there are always going to be too many sharp edges and the results will be too poor in all but the simplest cases for it to be worth supporting. There are clear ways to start improving it but without a clear ending point I don't want to go down the path of cobbling together an autorouter. Still, for the sake of experimentation and discussion, here is roughly how you'd do some basic pathfinding.

The idea is that the interface would look like this: for your schematic-aware rule MyRouteRule you implement reconcile! and _route_leg! as usual, plus a callback _update_rule!(sch, node, rule::MyRouteRule) that gets called during plan, which fills in any required information like exclusion areas based on the schematic so far.

image

The road from here would probably look like this:

  • Don't construct the whole graph, just queue neighbors at each point [less memory and we can make sure it's deterministic for ties]
  • Check for obstructions rather than center-of-grid-cell-in-polygon (store edges in spatial index)
  • Choose waypoints in a way that doesn't tend to force bend radius to be half grid step
  • Minor changes needed to allow StraightAnd45 and BSplineRouting
  • More robust against users excluding their start/end points
  • Allow preference for gravity or more/fewer bends
  • Record and store waypoints for reuse rather than pathfinding every run
  • ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant