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
961fc02678
primitive: Move `.core()` to a trait only implemented by bends
2023-11-05 13:25:28 +00:00
Mikolaj Wielgus
a6481cb839
band,bow: Remove unused band, bow modules, add new traverser module
...
Implement a traverser for wrapped bends.
2023-11-04 18:28:12 +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
5b2e421493
graph,primitive: Implement new `GetWidth` trait
2023-10-27 09:45:52 +00:00
Mikolaj Wielgus
fae2ada334
graph: Remove width from loose seg weights, add it to fixed bend weights
2023-10-27 08:41:03 +00:00
Mikolaj Wielgus
21ed14ae3d
primitive: Implement appropriate `GetEnds` for primitives
...
Earlier I put a common implementation as a placeholder, now replaced it
with a correct implementation.
2023-10-25 15:29:13 +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
d5acfaccb5
primitive: Remove `.prev_bend()` and `.next_bend()` for now
...
Commented out the experimental code parts that use tem.
2023-10-25 15:29:09 +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
2966df6b2c
graph: Move boilerplate `impl`s to a new `impl_type` macro
2023-10-21 06:04:41 +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
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
c9d0b2178e
tracer: Add some initial code for squeezing/tucking
...
Not functional yet.
2023-10-17 03:16:02 +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
1a271cd89c
Add `node_count == size` invariant for `Layout`
2023-09-15 01:30:23 +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
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
356154c914
Make inner and outer circle obtainable from `Shape`
2023-08-22 21:40:10 +02:00
Mikolaj Wielgus
a077dfbca2
Don't collide with the same net
2023-08-18 02:39:11 +02:00
Mikolaj Wielgus
4f473bacec
Exclude mesh neighbors from collision detection
2023-08-16 19:55:12 +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
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
9c75151d3a
Implement .next() and .prev() methods to traverse along traces
2023-07-23 01:36:22 +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
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