//! This module defines primitive shapes.1//! The origin is (0, 0) for 2D primitives and (0, 0, 0) for 3D primitives,2//! unless stated otherwise.34mod dim2;5pub use dim2::*;6mod dim3;7pub use dim3::*;8mod inset;9pub use inset::*;10mod half_space;11mod polygon;12pub use half_space::*;13mod view_frustum;14pub use view_frustum::*;1516/// A marker trait for 2D primitives17pub trait Primitive2d {}1819/// A marker trait for 3D primitives20pub trait Primitive3d {}2122/// The winding order for a set of points23#[derive(Clone, Copy, Debug, PartialEq, Eq)]24#[doc(alias = "Orientation")]25pub enum WindingOrder {26/// A clockwise winding order27Clockwise,28/// A counterclockwise winding order29#[doc(alias = "AntiClockwise")]30CounterClockwise,31/// An invalid winding order indicating that it could not be computed reliably.32/// This often happens in *degenerate cases* where the points lie on the same line33#[doc(alias("Degenerate", "Collinear"))]34Invalid,35}3637/// A trait for getting measurements of 2D shapes38pub trait Measured2d {39/// Get the perimeter of the shape40fn perimeter(&self) -> f32;4142/// Get the area of the shape43fn area(&self) -> f32;44}4546/// A trait for getting measurements of 3D shapes47pub trait Measured3d {48/// Get the surface area of the shape49fn area(&self) -> f32;5051/// Get the volume of the shape52fn volume(&self) -> f32;53}545556