Commit Graph

74 Commits

Author SHA1 Message Date
Mikolaj Wielgus 59024d5e74 layout,math: create some error types
We need this for debugging, as we need some better way to display what
intersects what at what moment. Otherwise it takes a lot of effort to
figure out what is going on.

I had to create some type annotations that appear superfluous. Might be
interference from the `contracts` library. This should be investigated.
2023-12-22 05:39:46 +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 5e3248014c graph: create `WraparoundableIndex` enum for wraparoundables 2023-12-17 01:44:00 +00:00
Mikolaj Wielgus 0706a8c258 primitive: Remove traverser objects
Tey were a bad idea. As such objects immutably borrow the layout, one
cannot use tem in a for loop that mutates it.
2023-12-16 13:24:47 +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 f2991af721 Remove dependency on `enum-as-inner` crate
Fixes https://codeberg.org/mikolaj/topola/issues/13
2023-12-13 14:29:07 +00:00
Mikolaj Wielgus 36710b7a51 tracer: Implement rudimentary wrapping around loose bends
Temporarily disabled bend-seg intersection to make it rudimentarily
work.
2023-11-15 15:42:58 +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 b84dab9d09 layout: Return an iterator over nodes instead of dots
It's more general. Needed because mesh will be also generated from fixed
and loose bends.
2023-10-30 16:05:36 +00:00
Mikolaj Wielgus 700ffb0096 draw,layout: Move segbend construction to `Layout`
The method to add loose dots is now private.
2023-10-29 16:07:43 +00:00
Mikolaj Wielgus 0cf7c718f3 primitive: Remove Option<...> as loose dot is always adjacent to a seg 2023-10-29 06:54:46 +00:00
Mikolaj Wielgus c163716a6a graph,layout,primitive: Use loose primitive variants for traces 2023-10-28 13:18:55 +00:00
Mikolaj Wielgus 4b46b2174b graph,primitive: Remove half-loose seg objects
It was complicating things too much. We would have needed a new `Head`
implementation.
2023-10-27 15:44:36 +00:00
Mikolaj Wielgus 3619c5eab4 layout: Combine primitive creation methods into generics 2023-10-26 14:32:44 +00:00
Mikolaj Wielgus cedc2253ca primitive,layout: Remove methods that assume order
There's should be no previous or next primitive, only this end and the
other end.
2023-10-25 15:29:13 +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 62579d98ba graph: Merge `FixedEnd` and `LooseEnd` into one `Adjacent` 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 403e3e4f98 graph: Remove the `untag` macro
To accomplish this, some more methods are moved to traits.
2023-10-21 04:37:18 +00:00
Mikolaj Wielgus 4549de098c primitive: Move `tagged_{prev,next}` to a trait
First step towards getting rid of the `untag` macro.
2023-10-20 23:44:20 +00:00
Mikolaj Wielgus 4d20362e00 primitive: Move `.weight()` method to a new `GetWeight` trait 2023-10-20 01:08:58 +00:00
Mikolaj Wielgus e271c82b7e graph: Remove `Tag` trait
Name `Index` enum variants explicitly instead.
2023-10-19 22:41:53 +00:00
Mikolaj Wielgus b52eefb1a3 cleanup: Remove unused imports, formatting 2023-10-19 20:29:31 +00:00
Mikolaj Wielgus 708fbb98f1 graph,primitive: Use enum_dispatch, rely on generics less 2023-10-19 20:07:26 +00:00
Mikolaj Wielgus 4e21ff754d primitive: Move `.shape()` to a new trait `MakeShape` 2023-10-19 06:38:57 +00:00
Mikolaj Wielgus ae9dd23b7c graph: Move `retag` to an enum-dispatched trait 2023-10-18 22:46:18 +00:00
Mikolaj Wielgus b7ff507302 shape: Use `enum_dispatch` for `Shape` 2023-10-18 02:33:03 +00:00
Mikolaj Wielgus 11c7f7fb12 layout: Don't modify bends while tey're in the R-tree 2023-10-17 22:37:40 +00:00
Mikolaj Wielgus 4ec32c97ba layout: Move R-tree remove out of `debug_assert`
Because of that release builds were panicking.
2023-10-14 04:47:30 +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 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 0e8a6d6e42 Create new `Band` struct to pass around whole bands 2023-10-05 19:52:59 +00:00
Mikolaj Wielgus 0695b1deab draw: Implement flipping the bend if a shorter one is available 2023-09-19 20:56:40 +02:00
Mikolaj Wielgus abf92c7f43 contracts: Fix R-tree envelope invariance test
Violations were not detected if shape changed but not the envelope
(which is the case when bends are flipped).
2023-09-19 20:44:05 +02:00
Mikolaj Wielgus f36f80537f layout: Add invariant testing R-tree envelope invariance 2023-09-19 15:40:26 +02:00
Mikolaj Wielgus 394510de8d layout: Add contracts for node and edge counts 2023-09-16 18:24:57 +02:00
Mikolaj Wielgus c94a4c716a draw: Add contracts for node counts 2023-09-15 22:10:29 +02:00
Mikolaj Wielgus 1a271cd89c Add `node_count == size` invariant for `Layout` 2023-09-15 01:30:23 +02:00
Mikolaj Wielgus 49038a4ddb Don't forget to reinsert bend into R-tree if bend extension fails 2023-09-05 04:23:26 +02:00
Mikolaj Wielgus 1ac8dd2828 Only remove node when collision is detected during placement
As the node is inserted into the R-tree only afterwards.
2023-08-31 22:45:51 +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 47b3ffba08 Some small improvements to iteration in graph and layout code 2023-08-28 04:12:25 +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