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 Nov 15, 2023
1 parent 427a736 commit 367220c
Show file tree
Hide file tree
Showing 5 changed files with 1,636 additions and 2 deletions.
3 changes: 3 additions & 0 deletions geo/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
* <https://github.com/georust/geo/pull/1083>
* Add `len()` and `is_empty()` to `MultiPoint`
* <https://github.com/georust/geo/pull/1109>
<https://github.com/georust/geo/pull/1063>
* 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", "voronoi"]
proj-network = ["use-proj", "proj/network"]
use-proj = ["proj"]
use-serde = ["serde", "geo-types/serde"]
delaunay = []
voronoi = ["delaunay"]

[dependencies]
earcutr = { version = "0.4.2", optional = true }
Expand Down
8 changes: 8 additions & 0 deletions geo/src/algorithm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ 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;
pub use vector_ops::Vector2DOps;
Expand Down
Loading

0 comments on commit 367220c

Please sign in to comment.