Skip to content

Commit

Permalink
Upstream rebase (#3)
Browse files Browse the repository at this point in the history
* chore: add spade as a dependency

although spade is a optional dependency, it looks like a good fit for
the default features. Including it has the effect of bringing in 3 new
dependencies:

- robust 0.2 (we already use this)
- optional 0.5
- spade 2.2

I'll try to speak to the spade maintainers. Maybe we can bump the robust
version in their crate to reduce dependencies further. Also it might
make sense to ask them if the optional crate provides any real value.

* feat: initial implementation of TriangulateSpade trait

* fix: ignore example pictures in doc tests

* chore: add changelog entry

* chore: fix comment

* chore: apply review suggestion for doc comments

* chore: capitalize Delaunay

* chore: fix typo: convertes -> converts

* chore: fix typo: achives -> achieves

* feat: put required methods into a sealed trait so we don't leak them

* feat: add tests for the shapes in the doc comments

* chore: add doc tests and move cleanup function to sealed trait

* chore: fix typo

* chore: apply review suggestion for naming

* chore: improve description, worsen english

* chore: fix weird line wrap

* fix: pass epsilon as parameter + rename points -> coords

* chore: add test for different snap radius values

* chore: add link that explains constrained Delaunay triangulations

* Add voronoi (#2)

* Add Delaunay triangulation

Signed-off-by: Ben Johnston <[email protected]>

* feat: Delaunay documentation

Signed-off-by: Ben Johnston <[email protected]>

* feat: Add Voronoi diagram

Signed-off-by: Ben Johnston <[email protected]>

* feat: Voronoi testing

Signed-off-by: Ben Johnston <[email protected]>

* feat: Remove ndarray crates

* chore: Remove unwanted Result

* feat: Remove Circle struct

* feat: Remove nested loop

* feat: Add test to trim intersection to None

* chore: Update CHANGES.md

* feat: Address review comments

---------

Signed-off-by: Ben Johnston <[email protected]>

---------

Signed-off-by: Ben Johnston <[email protected]>
Co-authored-by: aviac <[email protected]>
Co-authored-by: RobWalt <[email protected]>
Co-authored-by: Stephan Hügel <[email protected]>
  • Loading branch information
4 people authored Nov 14, 2023
1 parent 8bae552 commit cc40e1f
Show file tree
Hide file tree
Showing 4 changed files with 792 additions and 1 deletion.
2 changes: 2 additions & 0 deletions geo/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
* <https://github.com/georust/geo/pull/1091>
* Add `wkt!` macro to define geometries at compile time.
<https://github.com/georust/geo/pull/1063>
* Add `TriangulateSpade` trait which provides (un)constrained Delaunay Triangulations for all `geo_types` via the `spade` crate
* <https://github.com/georust/geo/pull/1083>
* Add `TriangulateDelaunay` and `VoronoiDiagram` traits.
* <https://github.com/franklin-ai/geo/pull/2>

Expand Down
3 changes: 2 additions & 1 deletion geo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rust-version = "1.65"
categories = ["science::geo"]

[features]
default = ["earcutr", "delaunay", "voronoi"]
default = ["earcutr", "spade", "delaunay", "voronoi"]
delaunay = []
proj-network = ["use-proj", "proj/network"]
use-proj = ["proj"]
Expand All @@ -22,6 +22,7 @@ voronoi = ["delaunay"]

[dependencies]
earcutr = { version = "0.4.2", optional = true }
spade = { version = "2.2.0", optional = true }
float_next_after = "1.0.0"
geo-types = { version = "0.7.9", features = ["approx", "use-rstar_0_11"] }
geographiclib-rs = { version = "0.2.3", default-features = false }
Expand Down
6 changes: 6 additions & 0 deletions geo/src/algorithm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ pub mod triangulate_earcut;
#[cfg(feature = "earcutr")]
pub use triangulate_earcut::TriangulateEarcut;

/// Triangulate polygons using an (un)constrained [Delaunay Triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation) algorithm.
#[cfg(feature = "spade")]
pub mod triangulate_spade;
#[cfg(feature = "spade")]
pub use triangulate_spade::TriangulateSpade;

#[cfg(feature = "delaunay")]
pub mod triangulate_delaunay;
#[cfg(feature = "delaunay")]
Expand Down
Loading

0 comments on commit cc40e1f

Please sign in to comment.