pub mod aabb;
pub mod arc2;
pub mod circle2;
pub mod closest;
pub mod curvature;
pub mod curve2;
pub mod intersect;
pub mod line2;

pub use aabb::Aabb2;
pub use arc2::{Arc2, arc_bounding_box};
pub use circle2::Circle2;
pub use closest::ClosestPoint2;
pub use curvature::Curvature;
pub use curve2::{Curve2, Curve2Kind};
pub use intersect::{IntersectionSet, intersect_curves};
pub use line2::Line2;

#[derive(Debug, thiserror::Error)]
pub enum KernelError {
    #[error("line endpoints coincide within tolerance")]
    DegenerateLine,
    #[error("arc sweep is within tolerance of zero or exceeds 2π")]
    DegenerateArc,
    #[error("circle radius is within tolerance of zero")]
    DegenerateCircle,
}

pub type Result<T, E = KernelError> = core::result::Result<T, E>;
