Commit Graph

125 Commits

Author SHA1 Message Date
Mikolaj Wielgus fcffb76de4 autorouter: create new command: Remove Selected Bands 2024-07-25 01:46:54 +02:00
Mikolaj Wielgus b568f2d790 autorouter: split selection into pin selection and band selection 2024-07-24 14:59:28 +02:00
Mikolaj Wielgus 3bf4d2cdb1 autorouter,board: use both band uids and band termsegs 2024-07-24 02:27:11 +02:00
Mikolaj Wielgus f7126dfa33 egui,autorouter: implement selecting bands 2024-07-23 13:36:57 +02:00
Mikolaj Wielgus 5da6ec4463 drawing: create methods for obtaining UIDs for bands 2024-07-23 02:03:55 +02:00
Mikolaj Wielgus c17c004aae cli: hard-code routing only the first layer by default
A temporary measure before we provide better layer control and prevent
duplication of routes.
2024-07-16 20:39:19 +02:00
Mikolaj Wielgus 87fd5d5d05 cli: make command file argument named and optional 2024-07-16 15:45:42 +02:00
Mikolaj Wielgus be9ff3a85a layout: rename "zone" to "poly"
We'll keep the term "zone" for higher-level concepts.
2024-07-09 23:09:39 +02:00
Mikolaj Wielgus c36ccc287a autorouter: improve error handling by removing some unwraps 2024-07-08 13:25:58 +02:00
Mikolaj Wielgus def3f84d6a egui,autorouter,router: highlight current obstacle 2024-07-04 00:39:08 +02:00
Mikolaj Wielgus b6cb89c017 egui,autorouter,router: display infringement shapes (aka. "ghosts") 2024-07-03 21:00:50 +02:00
Mikolaj Wielgus 806742736a cleanup: get rid of `*Trait` names for traits, use verbs and sentences 2024-07-03 13:40:37 +02:00
Mikolaj Wielgus 47c888d21b egui,autorouter,router: restore highlighting active navmesh edges 2024-07-01 18:56:41 +02:00
Mikolaj Wielgus 2259a75d92 egui,autorouter: restore displaying navmesh 2024-07-01 00:50:24 +02:00
Mikolaj Wielgus fd5a95103d autorouter: step through every band routing step, not merely over bands 2024-06-29 03:07:20 +02:00
Mikolaj Wielgus ea991314b2 board: remove `.remove_band()` method 2024-06-28 19:35:25 +02:00
Mikolaj Wielgus 4fa97509e4 router: split out `Trace` to its own file and give it its own methods
We'll be following this pattern:
* `Autorouter` - `Autoroute`,
* `Router` - `Route` (not yet done),
* `Tracer` - `Trace`.

Agent nouns (ending with -er) denote the object that holds large and
"unportable" parts of the state (such as `Board`, `Layout`, `Drawing`,
`Geometry`), while verbs (ending with -e) denote holders of other, more
"portable" parts of the state.
2024-06-27 23:58:02 +02:00
Mikolaj Wielgus 3ce8cfcabc autorouter: fix redo operation
Redone operation was only dispatched, not truly executed.
2024-06-25 11:20:59 +02:00
Mikolaj Wielgus 0777b781f4 router: have two navvertices, CW and CCW, for each trianvertex 2024-06-22 17:33:11 +02:00
Mikolaj Wielgus c24d748bea autorouter: don't save in history until command is successfully finished 2024-06-20 12:14:51 +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 e15e1efe5e router: remove observers
The observer "pattern", arguably, is an anti-pattern that managed to get
into textbooks. It causes a lot of problems, it was a bad idea to use
it.
2024-06-18 01:37:45 +02:00
Mikolaj Wielgus cff6b5aaf6 cleanup: cargo fix, cargo fmt 2024-06-13 13:38:12 +02:00
Mikolaj Wielgus 90bc90350d tests: test via placement failure 2024-06-12 01:51:04 +02:00
Mikolaj Wielgus b09ffad9b3 autorouter: create new command for placing vias
Undoing it is not implemented yet.
2024-06-10 02:38:24 +02:00
Mikolaj Wielgus 6b6affb3fc autorouter: move autoroute command to its own file
Since it accesses `Autorouter`'s fields, I made these `pub(super)`. This
feels unidiomatic, but let's give it a shot.
2024-06-10 02:38:03 +02:00
Mikolaj Wielgus fc1f7e2613 layout: implement storage for vias 2024-06-09 17:24:12 +02:00
Mikolaj Wielgus 7a02877eb4 board,dsn: move layer and net name bidirectional lookup to `Mesadata` 2024-06-08 21:39:25 +02:00
Mikolaj Wielgus 19a4766cb5 board,dsn: introduce `MesadataTrait`, an extension of `RulesTrait`
The trait's contents aren't implemented yet.

"mesa" is supposed to mean the opposite of "meta". By "mesadata" I don't
mean mere content or payload: I mean data that is stored *inside* or
*under* such content or payload.

I found this meaning of "mesa" -- as opposite of "meta" -- by browsing
somewhere on the internet. Fair chance many classicists would think
poorly of this usage. But I don't care about etymology: I just need a
word to close a lexical gap.
2024-06-08 16:36:21 +02:00
Mikolaj Wielgus 1dc3718159 board: move board to its own directory 2024-06-08 13:37:27 +02:00
Mikolaj Wielgus 91480453b3 tests: add 3-pin XLR THT female to THT female test
Hardly functional so far.
2024-06-07 02:14:05 +02:00
Mikolaj Wielgus e574043c2f tests: move common code to new common module 2024-06-06 02:30:25 +02:00
Mikolaj Wielgus a02bf1541e autorouter: implement measurement of band length 2024-06-05 23:20:55 +02:00
Mikolaj Wielgus 86d2555b36 autorouter: accessibly store pin-pairs between which routed bands are 2024-06-05 20:26:23 +02:00
Mikolaj Wielgus 5eeeb5a004 autorouter: select nodes with pin-layer pairs, not only pins
We call these pairs "selectors".

The command file format has been thus changed. I've upgraded the command
files in tests with the following command:

    jq ".done?.[].Autoroute |= {selectors: ([.pins.[] | {pin: ., layer: \"F.Cu\"}])}" $FILE | sponge $FILE

Where $FILE is the name of the upgraded command file.
2024-06-04 01:54:10 +02:00
Mikolaj Wielgus bb6d975dac autorouter: store layer to layer names map in `Board` 2024-06-03 13:44:09 +02:00
Mikolaj Wielgus fa8c11fa36 autorouter: move lazy apex accessor to `Board` 2024-06-03 12:46:36 +02:00
Mikolaj Wielgus a80dfc10be autorouter,router: shorten and clarify terminology
Rename "triangulation vertex" to just "trianvertex".
Rename "navigation vertex" to just "navvertex".

The standalone word "vertex" was overused and in some cases confusing.
2024-06-03 12:46:27 +02:00
Mikolaj Wielgus 765d8495c6 tests: add four 3rd order SMD LC filters test 2024-06-01 00:34:09 +02:00
Mikolaj Wielgus 540d9707dc autorouter: store a net to netname map in `Board` 2024-05-31 23:13:57 +02:00
Mikolaj Wielgus de17adb01c layout: move pin information to a new parent object, `Board` 2024-05-31 01:47:51 +02:00
Mikolaj Wielgus b22e3dce1a router,autorouter: stop hiding layout behind an arc-mutex
This was preventing us from creating a new abstraction layer over
layout.
2024-05-30 22:57:20 +02:00
Mikolaj Wielgus dcbc5be5f3 router,autorouter: improve error handling
Avoid unwrapping and use `Result<...>` instead as well-written code
should.
2024-05-30 19:54:14 +02:00
Mikolaj Wielgus a4503a42c6 router: improve error handling -- more error types, remove some unwraps 2024-05-29 23:49:24 +02:00
Mikolaj Wielgus 499564e6cf router: make A* a walker, i.e. make it runnable in a while loop 2024-05-27 23:50:12 +02:00
Mikolaj Wielgus 06150f5167 autorouter: don't cache nodes in `Selection`
This solves the problem of having to use stateful deserialization.
2024-05-23 20:00:43 +02:00
Mikolaj Wielgus 53fa89d02c egui: implement loading the history (not functional yet)
Committing this non-functional and half-baked because loading the
history requires implementing stateful deserialization, which is quite
an effort to implement with Serde, as there are no applicable derive
macros.
2024-05-23 19:34:19 +02:00
Mikolaj Wielgus 02bfe1105b egui: Implement saving command file 2024-05-22 14:38:59 +02:00
Mikolaj Wielgus fb501ac072 autorouter: encapsulate command history in a `History` object 2024-05-22 01:12:55 +02:00
Mikolaj Wielgus f03545124f autorouter: keep track of clicked pins
Pin names provide us stable references that we can use to replay actions
later. We'll use this information to serialize the selection.
2024-05-19 04:37:26 +02:00
Mikolaj Wielgus 530f81557a layout: keep track of node pins
For the time being we're storing pin names in a hashmap with nodes as
keys. We need to know which node belongs to which pin because pins
provide stable identifiers for continents (connected components) that
we need for replayable command files.
2024-05-17 02:22:48 +02:00
Mikolaj Wielgus 4a4f18f558 egui,autorouter: implement undo/redo in GUI 2024-05-15 03:40:48 +02:00
Mikolaj Wielgus 1c09483873 autorouter: implement simple undo (untested, not in GUI yet) 2024-05-14 14:22:47 +02:00
Mikolaj Wielgus 4c6fa0e5d3 layout: remove concepts of connectivity, bands, and continents for now
We'll use `UnionFind` where needed for now.
2024-05-13 18:43:42 +02:00
Mikolaj Wielgus 8a3bf45fd8 egui: store invoker in state instead of reconstructing it each time 2024-05-13 04:28:13 +02:00
Mikolaj Wielgus 7bcb3926d4 autorouter: put autorouter in new `Invoker` object for Command pattern 2024-05-13 03:20:57 +02:00
Mikolaj Wielgus d9ff08477c autorouter: encapsulate selection in `Selection` object
Just a thin wrapper over `HashSet` for now, but will contain more
complicated logic later.
2024-05-13 03:20:47 +02:00
Mikolaj Wielgus f893f73cd8 autorouter: autoroute only selected 2024-05-12 20:29:07 +02:00
Mikolaj Wielgus a6fb1157e3 egui,tests: fix compilation errors 2024-05-12 01:57:40 +02:00
Mikolaj Wielgus 36bc606401 autorouter: fix off-by-one error when walking over ratlines 2024-05-11 05:00:53 +02:00
Mikolaj Wielgus a5dcacdd69 egui: draw routing start and stop 2024-05-10 20:37:13 +02:00
Mikolaj Wielgus 9ac4c780b5 router: store origin and target in navmesh 2024-05-10 19:54:03 +02:00
Mikolaj Wielgus c1db44c25f autorouter: reorder code to avoid peeking in the edges iterator 2024-05-10 19:38:14 +02:00
Mikolaj Wielgus 83f3245e55 router: exclude same-net nodes from navmesh (except for start and stop) 2024-05-10 01:25:00 +02:00
Mikolaj Wielgus 91f9466d74 autorouter,router: route only single layer at a time
It makes no sense to route multiple layers at once until we implement
automatic via placement, which is going to take a lot of time.
2024-05-07 20:06:54 +02:00
Mikolaj Wielgus 765738f44b autorouter: treat (layer, net) pairs like separate nets for ratsnest
Most likely we won't be having via placement anytime soon, so let's
narrow our routing capabilities to single layer at a time.
2024-05-07 02:09:48 +02:00
Mikolaj Wielgus eaecb99146 egui: draw the navmesh
This required some considerable rearrangements in `Router`.
2024-05-06 02:35:43 +02:00
Mikolaj Wielgus 946f2dbd6c autorouter: make it possible to delegate the loop outside `.autoroute()` 2024-05-05 17:55:47 +02:00
Mikolaj Wielgus a2c8ae7e70 autorouter: put `Layout` in a mutex 2024-05-04 18:02:34 +02:00
Mikolaj Wielgus 2be8baab55 autorouter: route all ratline endpoint pairs
Routed bands are intersecting with each other for some reason, but at
least this doesn't crash.
2024-05-03 01:36:07 +02:00
Mikolaj Wielgus 531bc6d22c autorouter: as a starter, route the endpoints of only the first ratline 2024-05-03 01:36:04 +02:00
Mikolaj Wielgus 9c332bdde3 egui: add "Autoroute" button
Not functional yet as I still haven't implemented
`Autorouter::autoroute()`
2024-05-02 18:53:43 +02:00
Mikolaj Wielgus ea22ba705c layout: create `Zone` struct for accessing zone properties 2024-05-01 20:57:49 +02:00
Mikolaj Wielgus c74e69a5e9 autorouter: move ratsnest to `Autorouter`, move overlay to egui module 2024-04-27 01:12:01 +02:00
Mikolaj Wielgus 81f9f82f40 overlay: move overlay to new autorouter module 2024-04-26 02:34:25 +02:00