//! 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 polygon;910/// A marker trait for 2D primitives11pub trait Primitive2d {}1213/// A marker trait for 3D primitives14pub trait Primitive3d {}1516/// The winding order for a set of points17#[derive(Clone, Copy, Debug, PartialEq, Eq)]18#[doc(alias = "Orientation")]19pub enum WindingOrder {20/// A clockwise winding order21Clockwise,22/// A counterclockwise winding order23#[doc(alias = "AntiClockwise")]24CounterClockwise,25/// An invalid winding order indicating that it could not be computed reliably.26/// This often happens in *degenerate cases* where the points lie on the same line27#[doc(alias("Degenerate", "Collinear"))]28Invalid,29}3031/// A trait for getting measurements of 2D shapes32pub trait Measured2d {33/// Get the perimeter of the shape34fn perimeter(&self) -> f32;3536/// Get the area of the shape37fn area(&self) -> f32;38}3940/// A trait for getting measurements of 3D shapes41pub trait Measured3d {42/// Get the surface area of the shape43fn area(&self) -> f32;4445/// Get the volume of the shape46fn volume(&self) -> f32;47}484950