Skip to content

Commit

Permalink
Add voronoi (#2)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
doc-E-brown committed Jan 24, 2024
1 parent 0e1802b commit 5792e1b
Show file tree
Hide file tree
Showing 5 changed files with 1,634 additions and 2 deletions.
2 changes: 2 additions & 0 deletions geo/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
<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>

## 0.26.0

Expand Down
6 changes: 4 additions & 2 deletions geo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ rust-version = "1.65"
categories = ["science::geo"]

[features]
default = ["earcutr", "spade"]
use-proj = ["proj"]
default = ["earcutr", "spade", "delaunay", "voronoi"]
delaunay = []
proj-network = ["use-proj", "proj/network"]
use-proj = ["proj"]
use-serde = ["serde", "geo-types/serde"]
voronoi = ["delaunay"]

[dependencies]
earcutr = { version = "0.4.2", optional = true }
Expand Down
7 changes: 7 additions & 0 deletions geo/src/algorithm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,13 @@ pub use triangulate_earcut::TriangulateEarcut;
pub mod triangulate_spade;
#[cfg(feature = "spade")]
pub use triangulate_spade::TriangulateSpade;
#[cfg(feature = "delaunay")]
pub mod triangulate_delaunay;
#[cfg(feature = "delaunay")]
pub use triangulate_delaunay::TriangulateDelaunay;

#[cfg(feature = "voronoi")]
pub mod voronoi_diagram;

/// Vector Operations for 2D coordinates
mod vector_ops;
Expand Down
Loading

0 comments on commit 5792e1b

Please sign in to comment.