-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add voronoi #2
Add voronoi #2
Conversation
Signed-off-by: Ben Johnston <[email protected]>
Signed-off-by: Ben Johnston <[email protected]>
Signed-off-by: Ben Johnston <[email protected]>
Signed-off-by: Ben Johnston <[email protected]>
geo/src/algorithm/voronoi_diagram.rs
Outdated
// The centres of the delaunay circumcircles form the vertices of the | ||
// voronoi diagram | ||
let mut vertices: Vec<Coord<T>> = Vec::new(); | ||
for tri in delaunay_triangles.iter() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.iter()
looks redundant here
geo/src/algorithm/voronoi_diagram.rs
Outdated
|
||
// Create the lines joining the vertices | ||
let mut voronoi_lines: Vec<Line<T>> = Vec::new(); | ||
for neighbour in shared.neighbours.iter() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again .iter()
probably not needed
let mut voronoi_lines: Vec<Line<T>> = Vec::new(); | ||
for neighbour in shared.neighbours.iter() { | ||
if let (Some(first_vertex), Some(second_vertex)) = (neighbour.0, neighbour.1) { | ||
voronoi_lines.push(Line::new(vertices[first_vertex], vertices[second_vertex])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this indexing of vertices
makes me squeamish, but meh ... looks safe
geo/src/algorithm/voronoi_diagram.rs
Outdated
f64: From<T>, | ||
{ | ||
let mut pts: Vec<Point<T>> = Vec::new(); | ||
for tri in triangles.iter() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.iter()
needed?
geo/src/algorithm/voronoi_diagram.rs
Outdated
// These connections to infinity will be bounded later | ||
// Add the connections from infinity | ||
let mut num_neighbours: Vec<usize> = triangles.iter().map(|_| 0).collect(); | ||
neighbours.iter().for_each(|x| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for x in neighbours.iter() { .. }
or for x in neighbours { .. }
geo/src/algorithm/voronoi_diagram.rs
Outdated
}; | ||
let m = -1. / slope; | ||
// y = mx + b | ||
let b = midpoint.y - m * midpoint.x; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let b = m.mul_add(-midpoint.x, midpoint.y)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this tip! TIL!
geo/src/algorithm/voronoi_diagram.rs
Outdated
// y = mx + b | ||
let b = midpoint.y - m * midpoint.x; | ||
let x = midpoint.x + f64::from(line.dx()); | ||
let y = m * x + b; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let y = m.mul_add(x, b)
geo/src/algorithm/voronoi_diagram.rs
Outdated
|
||
impl GuidingDirection { | ||
// The common point is the end co-ordinate of both lines | ||
fn from_midpoints<T: GeoFloat>(line_a: &Line<T>, line_b: &Line<T>) -> GuidingDirection { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GuidingDirection
here can be Self
geo/src/algorithm/voronoi_diagram.rs
Outdated
// to the left or right of the other midpoints, or | ||
// above of below the other midpoints | ||
if (dx_a == dx_b) && dx_a { | ||
GuidingDirection::Right |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self
here and one following lines
geo/src/algorithm/voronoi_diagram.rs
Outdated
_ => return Err(VoronoiDiagramError::UnexpectedDirectionForInfinityVertex), | ||
} | ||
} else { | ||
let b = circumcenter.y - line.slope() * circumcenter.x; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
give b
a better name?
geo/src/algorithm/voronoi_diagram.rs
Outdated
|
||
// Get the vertices with connections to infinity | ||
let mut inf_lines: Vec<Line<T>> = Vec::new(); | ||
for neighbour in neighbours.iter() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.iter()
?
geo/src/algorithm/voronoi_diagram.rs
Outdated
|
||
#[cfg(test)] | ||
mod test { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary blank line
None | ||
} | ||
|
||
fn add_point<T: GeoFloat>(triangles: &mut Vec<DelaunayTriangle<T>>, c: &Coord<T>) -> Result<()> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Result<()>
unnecessary? I dont see any return or ?
inside
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c
-> coord
or point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c
->coord
orpoint
I renamed add_point
to add_coordinate
bad_triangle_edge_count.push(1); | ||
} | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add trailing ;
let flipped_y = Line::new(y.end, y.start); | ||
let idx = | ||
find_line(y, &bad_triangle_edges).or(find_line(&flipped_y, &bad_triangle_edges)); | ||
match idx { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if let Some(idx) = idx { .. } else { ... }
is less nesting
|
||
let mut bad_triangle_edges: Vec<Line<T>> = Vec::new(); | ||
let mut bad_triangle_edge_count: Vec<u128> = Vec::new(); | ||
bad_triangles.iter().for_each(|x| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for_each
not needed here.
im less sure about the inner for_each
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean replace the for_each
for a std for
loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, this is more readable
for x in &bad_triangles {
for y in x.0.to_lines() {
...
there are a few changes needed inside to make it work.
|
||
// Replace the triangles | ||
triangles.clear(); | ||
new_triangles.iter().for_each(|x| triangles.push(x.clone())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be more efficient to return new_triangles
, and then this fn doesnt need a mut input
* 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]>
* 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]>
* 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]>
* 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]>
* 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 len to MultiPoint. * Add is_empty to MultiPoint. * Add entry to geo/CHANGES.md for len and is_empty on MultiPoint. * prepare for geo-types 0.7.12 release * Prepare for 0.27.0 release * Update Cargo.toml * geo now requires at least geo-types 0.7.12 for the wkt macro and the `use-rstar_0_11` feature flag. * 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]> * Upstream rebase (#3) * 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]> --------- 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]> Co-authored-by: andriyDev <[email protected]> Co-authored-by: Michael Kirk <[email protected]> Co-authored-by: Corey Farwell <[email protected]>
* 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]>
* 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]>
* 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 len to MultiPoint. * Add is_empty to MultiPoint. * Add entry to geo/CHANGES.md for len and is_empty on MultiPoint. * prepare for geo-types 0.7.12 release * Prepare for 0.27.0 release * Update Cargo.toml * geo now requires at least geo-types 0.7.12 for the wkt macro and the `use-rstar_0_11` feature flag. * 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]> * Upstream rebase (#3) * 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]> --------- 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]> Co-authored-by: andriyDev <[email protected]> Co-authored-by: Michael Kirk <[email protected]> Co-authored-by: Corey Farwell <[email protected]>
* 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]> * Upstream rebase (#3) * 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]> * Upstream rebase (#3) (#6) * 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 len to MultiPoint. * Add is_empty to MultiPoint. * Add entry to geo/CHANGES.md for len and is_empty on MultiPoint. * prepare for geo-types 0.7.12 release * Prepare for 0.27.0 release * Update Cargo.toml * geo now requires at least geo-types 0.7.12 for the wkt macro and the `use-rstar_0_11` feature flag. * 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]> * Upstream rebase (#3) * 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]> --------- 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]> Co-authored-by: andriyDev <[email protected]> Co-authored-by: Michael Kirk <[email protected]> Co-authored-by: Corey Farwell <[email protected]> * Add package to cloudsmith for testing and internal use (#5) * feat: Prepare for cloudsmith * chore: Add cloudsmith registry * feat: Bump version to alpha * feat: Remove need for cloudsmith geo-types * feat: Improve infinity line construction (#7) * fix: Remove duplicate points (#8) * feat: Remove duplicate points from delaunay * feat: Flag invalid delaunay triangulation * chore: Bump cloudsmith version * Fix: Infinity line construction (#9) * feat: Voronoi working Signed-off-by: Ben Johnston <[email protected]> * feat: Some refactoring * feat: Improve clipping mask operation --------- Signed-off-by: Ben Johnston <[email protected]> * chore: Correct changelog entry --------- 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]> Co-authored-by: andriyDev <[email protected]> Co-authored-by: Michael Kirk <[email protected]> Co-authored-by: Corey Farwell <[email protected]>
Add voronoi diagram functionality. This is a big PR and will require a walk-through and explanation.
Still TODO: