Commit Graph

37 Commits

Author SHA1 Message Date
Mikolaj Wielgus 8379470bb1 mesh: Split out `Mesh` into a new `Triangulation` struct
It will be possible for the mesh to contain additional vertices that
aren't part of the Delaunay triangulation. `Mesh` is now a wrapper over
`Triangulation` that implements the same traits, and will be later
adding its own vertices in addition to the ones from triangulation.
2023-11-04 22:49:20 +00:00
Mikolaj Wielgus 13e38c6889 mesh: Use a tagged graph index as vertex index instead of a Spade handle 2023-11-04 18:33:14 +00:00
Mikolaj Wielgus a3cedff577 mesh: Make it possible for fixed and loose bends to be vertices
But not adding tem to the mesh yet, as it's going to take some effort.
2023-10-30 18:28:03 +00:00
Mikolaj Wielgus c46d8c7434 tracer: Starting and finishing is always on a fixed dot 2023-10-30 15:50:35 +00:00
Mikolaj Wielgus aaad590870 primitive: Remove `.tagged_prev()`, `.tagged_next()` methods
Temporarily commented out band code which relied on tem.
2023-10-25 15:29:13 +00:00
Mikolaj Wielgus 0dac23f018 graph,layout: Add creation methods for new primitives and a new label 2023-10-22 05:07:53 +00:00
Mikolaj Wielgus a2531b078d graph,primitive: Split the 3 primitives into 7
`Dot` becomes `FixedDot` and `LooseDot`.
`Seg` becomes `FixedSeg`, `HalfLooseSeg`, and `FullyLooseSeg`.
`Bend` becomes `FixedBend` and `LooseBend`.

The fixed variants differ from the loose variants by being unchangeable
for the router (though probably will be pushable in some cases, but
that's for later). So typically tey're going to be the initial
conditions.

For now only the fixed variants are used even if actually loose, to
split this change into several commits.
2023-10-22 02:05:22 +00:00
Mikolaj Wielgus 4d20362e00 primitive: Move `.weight()` method to a new `GetWeight` trait 2023-10-20 01:08:58 +00:00
Mikolaj Wielgus b52eefb1a3 cleanup: Remove unused imports, formatting 2023-10-19 20:29:31 +00:00
Mikolaj Wielgus 087d1deea0 router: Don't try to route around target dot
This was causing a panic, as it's not possible to route from *around* a
dot *into* the same dot.
2023-10-17 03:55:21 +00:00
Mikolaj Wielgus bfbad933e2 debug: Create and use `before_probe` observer for search visualization
Also changed `as_*`s to `into_*`s.
2023-10-13 04:00:01 +00:00
Mikolaj Wielgus 4e8e9298e6 astar: Probe neighbors before adding tem to queue 2023-10-12 00:19:38 +00:00
Mikolaj Wielgus af61a6b120 router: Rename `Route` to `Tracer` and simplify related code 2023-10-11 22:23:18 +00:00
Mikolaj Wielgus cc3b537b5c debug: Visualize A* running during interactive routing 2023-10-10 21:09:21 +00:00
Mikolaj Wielgus 7a06a9b02d router: Implement basic cursor following 2023-10-06 22:41:59 +00:00
Mikolaj Wielgus 5f37ff7616 Unroute path whose routing failed in the middle 2023-09-05 02:03:32 +02:00
Mikolaj Wielgus 7d76051cbf Route to goal immediately if a straight path exists at any vertex 2023-09-03 05:43:08 +02:00
Mikolaj Wielgus 73a831ba6d Visualize every routing search step 2023-09-03 01:56:46 +02:00
Mikolaj Wielgus c492bd1dda Parametrize routing using `RouteStrategy` trait 2023-09-02 06:05:13 +02:00
Mikolaj Wielgus bea6d84878 Implement `AstarStrategy` trait to not borrow A* context multiple times 2023-09-02 01:44:35 +02:00
Mikolaj Wielgus b5f9a5957a Route with A* step by step instead of only after A* 2023-09-01 01:35:48 +02:00
Mikolaj Wielgus cd5365c26f Pass `width` as an argument instead of holding it in `Route` 2023-08-31 21:17:25 +02:00
Mikolaj Wielgus e5ba7401c1 Move routing methods to the `Route` struct
Commented out shove/squeeze features for now.
2023-08-31 20:33:34 +02:00
Mikolaj Wielgus 9f201d2c3d Make `Head`, `Segbend`, `Bow` copyable
Having to move or borrow tem, especially `Head`, makes it really
difficult to appease the borrow checker.
2023-08-31 07:27:42 +02:00
Mikolaj Wielgus 1d5b428bf9 Split out drawing routines from `Router` into `Draw` 2023-08-30 06:34:56 +02:00
Mikolaj Wielgus 247b78087c Add methods to unroute or undraw segbends 2023-08-29 21:11:03 +02:00
Mikolaj Wielgus f2346eedb8 Run `cargo fix`
This hasn't cleaned up all the unused import, but it's a good start.
2023-08-29 05:02:45 +02:00
Mikolaj Wielgus ceef3a7fb7 Take `&impl Interior` argument in path removal method 2023-08-29 01:59:11 +02:00
Mikolaj Wielgus 47aadfcdd3 Introduce `Segbend`, a seg-dot-bend triple 2023-08-29 01:49:37 +02:00
Mikolaj Wielgus 79a26cb324 Split `Walk` trait into `Interior` and `Ends` traits 2023-08-28 22:54:03 +02:00
Mikolaj Wielgus 84a7f5d873 Make `Bow` don't borrow the graph 2023-08-28 19:17:57 +02:00
Mikolaj Wielgus 47b3ffba08 Some small improvements to iteration in graph and layout code 2023-08-28 04:12:25 +02:00
Mikolaj Wielgus 14f6b9f870 Implement basic A* routing 2023-08-27 21:14:42 +02:00
Mikolaj Wielgus 9196d95546 Triangulate only after drawing finishes
Otherwise we'll end up with the (not yet implemented) pathfinding
algorithm trying to route traces with themselves.
2023-08-26 22:25:01 +02:00
Mikolaj Wielgus a1afd19fcb Implement Petgraph's graph traits on a Spade's triangulation 2023-08-25 23:39:44 +02:00
Mikolaj Wielgus 658bb112c2 Move Delaunay triangulation to a new `Mesh` struct 2023-08-24 21:23:37 +02:00
Mikolaj Wielgus 8456259b38 Rename `Layout` to `Router`, `Mesh` to `Layout` 2023-08-24 03:32:50 +02:00