Commit Graph

50 Commits

Author SHA1 Message Date
Ellen Emilia Anna Zscheile 2394fa6256 feat(geometry/geometry): Add convenience GetPetgraphIndex impls 2025-05-17 02:43:19 +02:00
Ellen Emilia Anna Zscheile 861869ab7c refactor(geometry): introduce CompoundEntryKind to suppport entry metadata
example usages would be marking the apex of a polygon explicitly,
or marking the nodes of a polygon which are part of the convex hull

- make ManageCompounds more generic
- removes unnecessary bounds on handles/refs
2025-04-30 14:11:31 +02:00
Ellen Emilia Anna Zscheile 670ddbe1f7 chore: apply clippy fixes 2025-03-25 00:17:57 +01:00
Ellen Emilia Anna Zscheile 6eb941a137 feat: merge planar-brute-embed into the topola monorepo
- feat: use OrderedPair instead of custon BandName/BandUid (note: changes ordering of BandUid)
- fix(crates): rename planar-brute-embed to planar-incr-embed
2025-02-16 18:31:31 +01:00
Ellen Emilia Anna Zscheile f2969decd0 feat/debug: make core::fmt::Debug output easier to read 2025-02-02 22:01:25 +01:00
Mikolaj Wielgus 9664f1a31a fix: get rid of some indeterminism by using B-trees instead of hash maps
I have replaced all instances of `HashMap<...>` with `BTreeMap<...>`,
of `HashSet<...>` with `BTreeSet<...>`, and all the uses of the `Hash`
trait with `Ord`.

I have done a few manual tests and found the behavior to be
deterministic between the GUI application launches. However, undoing an
autoroute command and then manually executing it once again continues to
produce variable results. I suppose this is because of some bug in the
code where edits are applied. Hence, the issue

https://codeberg.org/topola/topola/issues/46

is only partially resolved.
2025-01-04 01:56:00 +01:00
Alain Emilia Anna Zscheile d88ba19e2b feat(graph): make indices serializable 2025-01-03 00:49:00 +01:00
Mikolaj Wielgus 44c30caafe chore(licensing): add REUSE license headers to `**.{rs,md,toml}` files
I ran the following command in Fish shell:

```
reuse annotate --skip-unrecognised --copyright="Topola contributors" --license="MIT" **.{rs,md,toml}
```

The choice of year 2024 in the copyright statements is intentional.
2024-12-29 22:47:00 +01:00
Mikolaj Wielgus 57c970e22e drawing: obtain `HeadRef` via new trait for abstract reference objects 2024-07-21 14:49:43 +02:00
Mikolaj Wielgus d4a310a5c0 graph: disambiguate naming of different kinds of indices
Disambiguate between node indices and (teir inner) petgraph indices.
Rename "band index" to "band first seg index", as we identify bands by
teir first segs. Rename "trianvertex index" and "navvertex index"
respectively to "trianvertex node index" and "navvertex node index", as
these point to nodes on the geometry graph and only indirectly to
vertices on the vertex graph.
2024-06-18 15:30:33 +02:00
Mikolaj Wielgus 4bb513ee08 cleanup: remove unused imports and traits 2024-01-28 15:01:13 +00:00
Mikolaj Wielgus c855853a79 primitive,geometry: move dot, seg shape-making code to `Geometry`
We still need to move the code for bends -- but that's for tomorrow.
2024-01-28 00:35:16 +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 46b50439c8 geometry: move wraparoundables to new module 2024-01-16 12:32:51 +00:00
Mikolaj Wielgus 9007b850c4 geometry: rename `Index` to `GeometryIndex` 2024-01-16 01:31:36 +00:00
Mikolaj Wielgus 0c6190e235 cleanup,layout: make connectivity and geometry private and clean up 2024-01-13 22:55:54 +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
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 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 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 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 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 3619c5eab4 layout: Combine primitive creation methods into generics 2023-10-26 14:32:44 +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 6f5a73759a guide: Take unqualified `{Dot,Seg,Bend}Index` unions as arguments 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 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 e271c82b7e graph: Remove `Tag` trait
Name `Index` enum variants explicitly instead.
2023-10-19 22:41:53 +00:00
Mikolaj Wielgus 708fbb98f1 graph,primitive: Use enum_dispatch, rely on generics less 2023-10-19 20:07:26 +00:00
Mikolaj Wielgus ae9dd23b7c graph: Move `retag` to an enum-dispatched trait 2023-10-18 22:46:18 +00: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 658bb112c2 Move Delaunay triangulation to a new `Mesh` struct 2023-08-24 21:23:37 +02:00
Mikolaj Wielgus c7f89c9fb9 Delaunay triangulation using Spade library 2023-08-19 05:55:28 +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 68c2863784 Implement basic shoving 2023-07-25 04:08:06 +02:00
Mikolaj Wielgus 925448802a Create a new `Set` trait for collections of node indices 2023-07-22 20:55:25 +02:00