Mikolaj Wielgus
43df065120
layout: move connectivity, band, loose to layout module
2024-01-30 00:43:56 +00:00
Mikolaj Wielgus
3fe54290c6
geometry: rename geometry submodule to layout, small typing changes
2024-01-27 16:20:04 +00:00
Mikolaj Wielgus
8c1b7d1e7e
geometry: move into own module, move dot, seg, bend to separate files
2024-01-27 13:42:33 +00:00
Mikolaj Wielgus
cded5eda7f
router: calculate lengths and estimate costs for A* search
2024-01-24 00:25:53 +00:00
Mikolaj Wielgus
bc72aa62d0
router: reimplement interactive routing
2024-01-23 18:06:41 +00:00
Mikolaj Wielgus
afe4c586b5
layout: implement removal of bands
2024-01-18 00:48:04 +00:00
Mikolaj Wielgus
1af5b96768
deps,graph: split out to new geometry and connectivity graph modules
...
The geometry graph is where the layout's dots, segs, and bends are
stored. The connectivity graph is where information about connected
components and relations between tem (e.g. which ones are connected with
bands) and information common to all band primitives are stored.
This removes dependency on the Slab library. We may go back to it
sometime in the future if we decide to phase out usage of Petgraph's
`StableDiGraph`.
2024-01-13 20:36:25 +00:00
Tomasz Cichoń
9a4e8357e7
deps: add thiserror and anyhow, reduce boilerplate
...
This adds rudimentary error messages and unsilences some errors.
2024-01-13 18:58:20 +01:00
Mikolaj Wielgus
95faf96030
router: handle tracer results
...
Pass the result of tracer probing step to the `.on_probe()` observer
method.
Unwrap the result of `.rework_path()`, as it should never fail as the
previous probe step should have ensured that this step is admissible.
2023-12-22 22:46:07 +00:00
Mikolaj Wielgus
84d5f9c49e
layout: implement almost working reworked squeezing-under
...
I've temporarily removed collision/infringement detection in
`.move_dot()` because it was a lot of effort to get it right. We'll deal
with this later.
There's a panic due to mesh edges not being generated properly from
loose bends. But this commit is already very large, so I'm going to fix
this in the next one.
There's also some nomenclature changes.
2023-12-19 02:22:55 +00:00
Mikolaj Wielgus
294e6c4f72
graph,layout,primitive: store band index instead of net in loose weights
2023-12-15 01:42:09 +00:00
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