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
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
73736fef50
primitive: create `GetWraparound` trait to get the wraparound
...
Wraparound is either the outer bend or the first rail bend. We need this
trait because some routines can wrap around both fixed and loose
primitives.
2023-12-17 01:43:55 +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
92834c66c8
graph: Store the offset from the bend immediately below in bend weight
2023-12-16 00:06:13 +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
b8f6b32341
graph,layout,primitive: Rename "layers" to "rails"
...
By "layer" we should be referring to the PCB layers. A "rail" shall be
one in a spatial sequence of parallel and topologically linked tracks,
which together shall be called a "railing".
2023-12-13 17:10:57 +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
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