Skip to content

Commit

Permalink
Fix documentation on voronoi_cell.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
andreesteve committed Jun 6, 2021
1 parent 235b4f9 commit 2a0357c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ impl<'t> Iterator for NeighborSiteIterator<'t> {
}
}

/// Iterator that produces a path between two point.
/// Iterator that produces a path between two points in the Voronoi diagram.
///
/// This will be the shortest path linking the starting cell to the cell that contains the destination point.
/// If the destionation point is not contained in the Voronoi diagram, the final cell in the path will be the
/// closest to the destination point.
#[derive(Clone)]
pub struct CellPathIterator<'t, 'p> {
site: usize,
Expand Down
5 changes: 3 additions & 2 deletions src/voronoi_cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ impl<'v> VoronoiCell<'v> {
self.site
}

/// Gets an iterator the indices of the triangles of the dual Delaunay triangulation that are associated with this cell.
/// Gets an iterator for the indices of the triangles in the dual Delaunay triangulation that are associated with this cell.
/// The Voronoi cell vertices are the circumcenters of the associated Delaunay triangles.
/// This is a way to index into the underlying Delaunay triangles and this cell's vertices.
///
/// If this cell is on the hull of the diagram (```cell.is_on_hull() == true```), or has had one of its edges clipped,
/// If this cell is on the hull of the diagram (```cell.is_on_hull() == true```), or has had one of its edges clipped, some indices will not match to
/// Delaunay triangles, but to virtual points added during the process of hull closing and clipping. These values will still correctly index into the [Voronoi::vertices()] vector.
#[inline]
pub fn iter_triangles(&self) -> impl Iterator<Item = usize> + 'v + Clone {
self.voronoi.cells[self.site].iter().copied()
Expand Down

0 comments on commit 2a0357c

Please sign in to comment.