Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Stitch trait #1087

Merged
merged 47 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
36539f3
feat: implement a stitch trait
RobWalt Oct 10, 2023
0bc9a60
test: add test and fixup small details of algorithm
RobWalt Oct 10, 2023
e8c36a0
chore: add changelog entry
RobWalt Oct 11, 2023
183939e
tests: add new failing tests
RobWalt Oct 12, 2023
3193aea
fix: make polygon stitching independent of orientation
RobWalt Oct 12, 2023
1ad39c5
tests: add new test and clean up old one
RobWalt Oct 13, 2023
e60b490
refactor: create macro for impls to cover all the usual cases
RobWalt Oct 13, 2023
e174944
test: add further test cases
RobWalt Oct 13, 2023
e8fb3b2
chore: remove unused code and unneeded publicness
RobWalt Oct 13, 2023
6475a0d
chore: write docs for the stitch trait
RobWalt Nov 14, 2023
e28848e
chore: cleanup stitching and reword to increase readability
RobWalt Nov 14, 2023
113e6a4
chore: additional cleanup + docs to make review easier
RobWalt Nov 28, 2023
bb6c425
chore: add example in doc comment of stitch_together
RobWalt Nov 28, 2023
148a071
chore: add picture to doc comment
RobWalt Nov 28, 2023
3afde3f
fix: fix doc test
RobWalt Nov 28, 2023
b72963c
chore: move change from changelog to unreleased
RobWalt Dec 12, 2023
854d51d
fix(review): doc comment formatting
RobWalt Jan 11, 2024
346df1d
chore(benches): add stitch benchmark
RobWalt Jan 11, 2024
c2e4337
perf(stitch): improve line comparison
RobWalt Jan 11, 2024
2e782e2
perf(stitch): n^2 loop to fold
RobWalt Jan 11, 2024
3e69011
perf(stitch): idomatic std use
RobWalt Jan 11, 2024
9e2f071
chore(stitch): remove clones
RobWalt Jan 11, 2024
9c4c392
fix(review): typo for consistency
RobWalt Jan 11, 2024
4a3cefd
chore(comments): add perf comments
RobWalt Jan 11, 2024
32531e8
docs(stitch): clarify edge cases
RobWalt Jan 12, 2024
f55ebb6
docs(stitch): more details
RobWalt Jan 12, 2024
5748e8e
refactor(stitch): macro function dispatch
RobWalt Jan 12, 2024
4297322
chore(cleanup): docs + simplifications
RobWalt Jan 12, 2024
173d7bc
fix(review): special case the algo to triangles only
RobWalt Jan 15, 2024
fb958f0
chore(cleanup): use pr suggestions
RobWalt Jan 19, 2024
5dbaaa0
Update geo/src/algorithm/stitch.rs
frewsxcv Jan 20, 2024
22ee4fa
fix(test): repair doc test
RobWalt Jan 23, 2024
95c0851
fix(review): don't use custom capacity
RobWalt Jan 23, 2024
47f9f28
chore(cleanup): remove unused error variants
RobWalt Jan 25, 2024
8b5e5b9
feat(visibility): make it all pub(crate)
RobWalt Jan 25, 2024
45f14ca
docs(stitch): improve doc string
RobWalt Jan 25, 2024
d0db3e1
fix(test): remote pub export
RobWalt Jan 25, 2024
b1ae9f9
chore(cleanup): comment benchmark out
RobWalt Jan 25, 2024
c08f84c
fix(tests): comment out failing doc test
RobWalt Jan 28, 2024
42d6906
refactor(helpers): move triangle winding function
RobWalt Feb 1, 2024
9927e71
chore: fix small typo
RobWalt Feb 1, 2024
c182742
chore: improve wording
RobWalt Feb 1, 2024
eaa66ac
chore: improve explaining comment
RobWalt Feb 1, 2024
a93c511
chore(tests): use `Relate` for testing
RobWalt Feb 1, 2024
39c0349
add comment about stitching results with holes
RobWalt Jul 26, 2024
715a319
bump spade version to fix ci
RobWalt Jul 26, 2024
4ecbd1e
try to fix CI errors
RobWalt Jul 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions geo/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* <https://github.com/georust/geo/pull/1199>
* Bump `geo` MSRV to 1.74 and update CI
* <https://github.com/georust/geo/pull/1201>
* Add `StitchTriangles` trait which implements a new kind of combining algorithm for `Triangle`s
* <https://github.com/georust/geo/pull/1087>

## 0.28.0

Expand Down
6 changes: 5 additions & 1 deletion geo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use-serde = ["serde", "geo-types/serde"]

[dependencies]
earcutr = { version = "0.4.2", optional = true }
spade = { version = "2.2.0", optional = true }
spade = { version = "2.10.0", optional = true }
float_next_after = "1.0.0"
geo-types = { version = "0.7.13", features = ["approx", "use-rstar_0_12"] }
geographiclib-rs = { version = "0.2.3", default-features = false }
Expand Down Expand Up @@ -122,3 +122,7 @@ harness = false
[[bench]]
name = "triangulate"
harness = false

[[bench]]
name = "stitch"
harness = false
24 changes: 24 additions & 0 deletions geo/benches/stitch.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// This needs a public export for the stitchtriangles trait. For now we decided to make it private
// so this benchmark is commented out. In case you need it and the trait still isn't public yet,
// you need to temporarily change that to make this benchmark work again.
//
// use criterion::{criterion_group, criterion_main, criterion};
// use geo::stitch::StitchTriangles;
// use geo::TriangulateSpade;
//
// fn criterion_benchmark(c: &mut criterion) {
// c.bench_function("stitch", |bencher| {
// let p = geo_test_fixtures::east_baton_rouge::<f32>();
// let tris = p.unconstrained_triangulation().unwrap();
//
// bencher.iter(|| {
// criterion::black_box(criterion::black_box(&tris).stitch_triangulation().unwrap());
// });
// });
// }
//
// criterion_group!(benches, criterion_benchmark);
// criterion_main!(benches);
fn main() {
println!("Placeholder");
}
4 changes: 4 additions & 0 deletions geo/src/algorithm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ pub use simplify::{Simplify, SimplifyIdx};
pub mod simplify_vw;
pub use simplify_vw::{SimplifyVw, SimplifyVwIdx, SimplifyVwPreserve};

/// Stitch together triangles with adjacent sides. Alternative to unioning triangles via BooleanOps.
#[allow(dead_code)]
pub(crate) mod stitch;

/// Transform a geometry using PROJ.
#[cfg(feature = "use-proj")]
pub mod transform;
Expand Down
Loading
Loading