jagua_rs/geometry/primitives/
error.rs1use crate::geometry::primitives::Point;
2
3#[derive(Debug, Clone, Copy, PartialEq, thiserror::Error)]
9pub enum GeometryError {
10 #[error("simple polygon must have at least 3 points, it has {0}")]
11 TooFewPoints(usize),
12 #[error("simple polygon contains duplicate points {0} and {1}")]
14 DuplicatePoints(usize, usize),
15 #[error("simple polygon contains intersecting edges {0} and {1}")]
18 IntersectingEdges(usize, usize),
19 #[error("simple polygon has no area")]
20 NoArea,
21 #[error("invalid rectangle, x_min: {x_min}, x_max: {x_max}, y_min: {y_min}, y_max: {y_max}")]
22 InvalidRect {
23 x_min: f32,
24 y_min: f32,
25 x_max: f32,
26 y_max: f32,
27 },
28 #[error("invalid circle, center: {center:?}, radius: {radius}")]
29 InvalidCircle { center: Point, radius: f32 },
30 #[error("degenerate edge, {0:?} == {0:?}")]
31 DegenerateEdge(Point),
32}