Commit Graph

91 Commits

Author SHA1 Message Date
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
Mikolaj Wielgus 234a52f9e8 Rename "route" to "draw" and "shove" to "squeeze"
The terms "route" and "shove" will be reserved to functions on the
higher level of abstraction.
2023-08-23 19:00:47 +02:00
Mikolaj Wielgus bbbd2f57fe Add `Guide` struct to generate guide curves 2023-08-23 05:15:16 +02:00
Mikolaj Wielgus c480111624 Display mesh edges 2023-08-18 22:37:21 +02:00
Mikolaj Wielgus 1a599951cd Implement basic failure for moving dot to obstructed place
Intersection with bends isn't working yet.
2023-08-15 04:10:55 +02:00
Mikolaj Wielgus 14c3acb633 Change `Shape` from struct to enum
It's more readable to use a match rather than an odd if condition.
2023-08-08 02:28:41 +02:00
Mikolaj Wielgus bdf3930894 Reinsert all bends into R-tree when moving a dot
This was causing a crash. Added some code that was used to debug this.
2023-08-02 00:28:52 +02:00
Mikolaj Wielgus 0c32ea7e41 Partial implementation of releasing bends
There's a panic when releasing (unbending) any of the inner bends in the
demo (the outer one works for some reason).
2023-07-31 05:06:09 +02:00
Mikolaj Wielgus f9ec5a0ef7 Implement basic interactive dragging and stretching 2023-07-29 22:29:08 +02:00
Mikolaj Wielgus e5a1c52655 Rename `Stretch` to `Bow`
I wanted to name it `String` (as in bowstring), but it's taken in Rust,
and `Bowstring` is longer than just `Bow`, and the thing in question is
very much bow-shaped, so I went with `Bow`.
2023-07-26 02:29:54 +02:00
Mikolaj Wielgus 68c2863784 Implement basic shoving 2023-07-25 04:08:06 +02:00
Mikolaj Wielgus 7c86b902aa Add `Stretch` object to hold bend together withs neighboring segs, bends 2023-07-23 03:45:16 +02:00
Mikolaj Wielgus 925448802a Create a new `Set` trait for collections of node indices 2023-07-22 20:55:25 +02:00
Mikolaj Wielgus f1772ca0be Store width and points instead of weights in `Shape` 2023-07-22 03:48:56 +02:00
Mikolaj Wielgus dea65a3b43 Add `untag!` macro, move `.shape()` to `Primitive` 2023-07-21 23:31:26 +02:00
Mikolaj Wielgus 8b5cfb3686 Rename `Primitive` to `Shape`, introduce new `Primitive`
Move some `Mesh` methods into `Primitive`.
2023-07-21 23:31:20 +02:00
Mikolaj Wielgus 69317384dd Separate dot and bend arounds. Keep an edge to the core from each bend 2023-07-21 05:40:04 +02:00
Mikolaj Wielgus 16990517b2 Make segs nodes instead of edges
This simplifies logic. Nodes store data as weights, while edges now only
describe relations between nodes with dataless enums -- labels.
2023-07-19 19:47:56 +02:00
Mikolaj Wielgus b5f85068df Store all relevant indexes as neighbors instead of in weights 2023-07-15 16:39:46 +02:00
Mikolaj Wielgus 26112724c7 Make bends nodes
This is necessary because bends may have more than two neighbors: apart
from the ends, there's also the node around which the bend is wrapped
(not yet made a neighbor, will be done in subsequent commits).
2023-07-14 12:40:30 +02:00
Mikolaj Wielgus bedd7c744a Add some utility functions for working with `Index`es and `Weight`s 2023-07-14 00:17:46 +02:00
Mikolaj Wielgus dabe364420 Pass around routing state with a new `Head` struct 2023-07-13 18:18:46 +02:00
Mikolaj Wielgus 0770917a41 Implement bending on bends
There's some ugly constants added here and there, will clean this up
later.
2023-07-12 11:15:54 +02:00
Mikolaj Wielgus dfcfc99413 Implement routing *into* dots 2023-07-12 01:01:59 +02:00
Mikolaj Wielgus cf6460a3db Initial commit
Very basic routing routines and data model. No pathfinding implemented
yet.
2023-07-12 01:01:25 +02:00