Commit Graph

132 Commits

Author SHA1 Message Date
Mikolaj Wielgus 97b1315eee refactor(autorouter/invoker): Expose getter for whole A* stepper, not just navmesh
Besides owning the navmesh, the A* stepper stores g-scores and f-scores,
displaying which will be helpful for debugging, so we want to be able to
access the whole A* stepper instead of only the navmesh.
2025-05-16 17:28:10 +00:00
Mikolaj Wielgus 7d5da2c797 docs(router/astar): Explain the meaning of every continue status 2025-05-16 17:28:10 +00:00
Mikolaj Wielgus a0ab7e2818 refactor(router/astar): Have separate statuses for discarded probes and skipped visits
This is mostly to improve readability. Since we don't check the values
of the continue statuses anywhere anyway, this doesn't result in any
changes to code outside of the router/astar module.
2025-05-16 17:28:10 +00:00
Mikolaj Wielgus 7dc275969c refactor(router/astar): Rename `Astar<...>` to `AstarStepper<...>`
Since it is a stepper, and we append -`Stepper` to identifiers denoting
types that are steppers.
2025-05-12 16:58:06 +02:00
Mikolaj Wielgus 0df68ee80c docs(stepper): Explain how stepper traits and navcord work
Navcord is special because we advance its state in a way that is similar
to how steppers are stepped but it actually is not a stepper.
2025-05-12 16:58:02 +02:00
Mikolaj Wielgus 47371fdf3f refactor(router/navcord): Make it clear that navcord is not a stepper
Rename `NavcordStepper<...>` to `Navcord<...>. Since the navcord is not
actually considered a true stepper, having the word "stepper" in its
identifier would confuse anyone new to source-diving Topola's code.

Rename Navcord's `.step(...)` to `.step_to(...)` to make it clear
that this is not just a step like in a stepper, but a step to a some
specified position.
2025-05-12 00:45:51 +02:00
Mikolaj Wielgus f7cd817457 feat(autorouter/invoker): Create trait to display debug information on navmesh 2025-05-01 01:59:31 +02:00
Mikolaj Wielgus b000f2b7d8 refactor(math): Replace `cw` booleans with `RotationSense` enums
The term "cw" (clockwise) was somewhat cryptic, using a more verbose
term improves readability.
2025-04-29 13:58:49 +02:00
Ellen Emilia Anna Zscheile 22460c75f7 refactor(DrawingException): factor out extraction of ghost+obstacle 2025-03-31 02:27:56 +02:00
Ellen Emilia Anna Zscheile c01c8046bb chore: cargo fmt 2025-03-25 23:06:04 +01:00
Ellen Emilia Anna Zscheile 670ddbe1f7 chore: apply clippy fixes 2025-03-25 00:17:57 +01:00
Ellen Emilia Anna Zscheile a836189086 refactor: simplify interface of NavcordStepper 2025-03-22 04:06:27 +00:00
Ellen Emilia Anna Zscheile da3be763c6 feat(overlay,viewport): generation and rendering of topological navmesh 2025-03-04 02:47:04 +01:00
Ellen Emilia Anna Zscheile a39546f0c9 fix(RouteStepper): borrowing mixup 2025-02-15 13:46:16 +01:00
Ellen Emilia Anna Zscheile a7c8474153 fix(RouteStepper): proper undo in case of failure
Fixes #116
(hopefully)
2025-02-15 13:36:32 +01:00
Ellen Emilia Anna Zscheile 0fde34204f refactor(drawing,geometry): move GetLayer from drawing::graph to geometry 2025-02-10 11:30:54 +01:00
Ellen Emilia Anna Zscheile 1e690ace11 refactor(drawing): factor out common {Bend,Dot,Seg}Weight fields 2025-02-10 11:29:08 +01:00
Ellen Emilia Anna Zscheile e1d875ae72 chore: fix most warnings 2025-02-10 11:25:55 +01:00
Ellen Emilia Anna Zscheile 5dab7d9100 refactor(navcord): inline 'binavvertex', 'maybe_cw' helpers 2025-02-02 22:03:12 +00:00
Ellen Emilia Anna Zscheile ba8aa2fe5a refactor(NavcordStepper): struct already stores 'width', don't pass it as argument 2025-02-02 22:03:12 +00:00
Ellen Emilia Anna Zscheile cf36177097 refactor: don't export modules only containing a single item 2025-02-02 22:03:12 +00:00
Ellen Emilia Anna Zscheile 2087e76dfe refactor(drawing::guide): turn Guide into a trait 2025-02-02 22:03:12 +00:00
Ellen Emilia Anna Zscheile 90544c12ed refactor(router::navcorder): turn Navcorder into a trait 2025-02-02 22:03:12 +00:00
Ellen Emilia Anna Zscheile 1d11011133 refactor(router::draw): turn Draw into a trait 2025-02-02 22:03:12 +00:00
Ellen Emilia Anna Zscheile 869d63f7c0 fix(navmesh): NavvertexIndex debug output should state what it is 2025-02-02 22:30:37 +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
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 1567a9a83e style: rename "squeeze through under bands" to "(...) bends"
Everywhere except in translatable strings. I'm not changing these
because I prefer this to be done via Weblate.
2024-12-29 01:43:36 +01:00
Alain Emilia Anna Zscheile 82bf647bc5 doc(router/navmesh): document maybe_cw
Doc Comment content taken from @mikolaj, Topola Matrix Chat.
2024-12-14 19:56:29 +01:00
Alain Emilia Anna Zscheile ba41ff6837 refactor: get rid of unnecessary bounds on struct generics 2024-12-12 16:38:26 +01:00
Alain Emilia Anna Zscheile 8a724dc5d2 chore: fix deprecation warnings about geo::EuclideanDistance 2024-12-12 06:54:37 +00:00
Alain Emilia Anna Zscheile 27a4b61c4d refactor(topola): get rid of unnecessary clones and lookups 2024-12-08 16:20:05 +00:00
Mikolaj Wielgus c87224e99a docs(router): add and rewrite some navmesh and navcord docstrings 2024-12-07 05:53:39 +01:00
Mikolaj Wielgus d17a34c0f6 fix(geometry,router,autorouter): some more fixes for edit recording 2024-12-03 00:39:02 +01:00
Mikolaj Wielgus fe8fd3909f fix(autorouter,router): actually propagate the edit out of route steppers
I forgot to do this earlier, and didn't notice because I didn't test
it. There are still a few changes to be done before recording and edit
applying is functional.
2024-12-02 05:56:37 +01:00
Mikolaj Wielgus 0760fb2da3 docs(drawing,router): rephrase docstrings some more 2024-12-02 01:25:45 +01:00
Mikolaj Wielgus 638979364c docs(drawing): rephrase docstrings 2024-12-01 23:42:40 +01:00
hakki 63804a0297 invoker: added trait description 2024-11-15 21:55:08 +00:00
Alain Emilia Anna Zscheile ddbaf2abe5 chore: fix cargo fmt 2024-11-15 20:46:29 +01:00
Mikolaj Wielgus d6fe67a373 feat(board,layout,drawing): implement edit recording
Not stored in the undo/redo objects yet.
2024-11-13 00:00:56 +00:00
hakki c1271e570e docs: navigation mesh documented 2024-10-29 19:53:47 +01:00
Mikolaj Wielgus dc11b5d8ff feat(egui,autorouter): make it possible to set routed band width 2024-10-21 02:48:04 +02:00
Mikolaj Wielgus 23d1eaa722 refactor: make `Step::step(...)` return `ControlFlow<...>`
This is an iteration on what was suggested in
https://codeberg.org/topola/topola/pulls/79 .

This removes the need to create a new status type for steppers that
have only one intermediate state, and removes unidiomatic `TryInto<...>`
usage to determine if a stepper has finished.
2024-10-12 05:38:57 +02:00
Mikolaj Wielgus a9e42eef17 refactor: make `Step`'s error an associated type
This was suggested in https://codeberg.org/topola/topola/pulls/79.
2024-10-12 05:38:57 +02:00
Mikolaj Wielgus 6104e761d2 refactor: autogenerate getters with `derive-getters` crate 2024-10-11 18:43:15 +02:00
Mikolaj Wielgus 8559734336 refactor: rename "trace" to "navcord", "tracer" to "navcorder"
Navcord stands for "navigation cord". I try to prefix anything that is
specific to the navmesh with the "nav-" prefix. I chose the word "cord"
as analogy to the terms "umbilical cord" (and by extension, umbilical
cable), and "power cord".

Calling this "trace" was misleading, as this term has other meanings
that are relevant to Topola: "trace" may refer to a debugging trace, and
more importantly, to a PCB track.

I've also shortened two comments that I found to mention the navcord as
"traces" during substitution.
2024-10-10 03:00:27 +02:00
Alain Emilia Anna Zscheile d0058ef5fd router: get rid of unnecessary RouterError 2024-10-06 00:22:32 +02:00
Alain Emilia Anna Zscheile 01deaa4b12 build(contracts): use contracts-try v0.7 from crates.io
`contracts-try` is now developed at
https://codeberg.org/topola/contracts-try and was extracted
from this repo, and rebased upon the original
crate sources to ensure proper attribution.

This removes the `vendored` directory.
2024-10-06 00:18:56 +02:00
Alain Emilia Anna Zscheile 04ab1ce69b router: TraceStepper is not a real stepper
Contributes towards solving #82 properly later.
2024-10-05 23:14:17 +02:00