diff options
Diffstat (limited to 'src/math/polygon')
| -rw-r--r-- | src/math/polygon/mod.rs | 2 | ||||
| -rw-r--r-- | src/math/polygon/polygon_graph.rs | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/math/polygon/mod.rs b/src/math/polygon/mod.rs index 98b1570..1577f63 100644 --- a/src/math/polygon/mod.rs +++ b/src/math/polygon/mod.rs @@ -15,6 +15,7 @@ use std::ops::Neg; use thiserror::Error; /// Describes errors that can happen when handling polygons, especially on creation. +#[allow(missing_docs)] #[derive(Debug, Error)] pub enum PolygonError<T: Scalar + Copy> { /// Since the polygon is not allowed to be complex, self intersection is an error. @@ -28,6 +29,7 @@ pub enum PolygonError<T: Scalar + Copy> { EdgeNotFound(LineSegment<T>), } +/// Describes a non-complex (non-self-intersecting) polygon, currently without holes. #[derive(Clone, Debug, Deserialize, Serialize)] // TODO: Support polygons with holes pub struct Polygon<T: Scalar + Copy> { diff --git a/src/math/polygon/polygon_graph.rs b/src/math/polygon/polygon_graph.rs index 5a730b0..fd373dd 100644 --- a/src/math/polygon/polygon_graph.rs +++ b/src/math/polygon/polygon_graph.rs @@ -1,3 +1,8 @@ +//! Polygon graphs are used for a more general approach than polygons. +//! +//! They are not polygons, but often describe a polygon and make some algorithms on polygons faster +//! or possible, which may not be practical on the polygon data alone. + use super::Polygon; use crate::math::{self, LineSegment, Vec2}; use nalgebra::{RealField, Scalar}; @@ -16,7 +21,7 @@ struct EdgeIterator<'a, T: Scalar + Copy> { /// An undirected graph, that is optimised for polygon edge operations. Since edges of a polygon /// are an undirected graph, this structure also holds both directions. This makes it rather space -/// inefficient, but makes edge operations rather swift. ß +/// inefficient, but makes edge operations rather swift. #[derive(Debug)] pub struct PolygonGraph<T: Scalar + Copy + PartialOrd> { /// The nodes of the graph, together with their adjacency list. |
