Boundary

Trait Boundary 

Source
pub trait Boundary:
    Clone
    + Send
    + Sync {
    type Scalar: RealField + Copy;

    // Required methods
    fn measure(&self) -> Self::Scalar;
    fn aabb_vec(&self) -> (Vec<Self::Scalar>, Vec<Self::Scalar>);
    fn validate(&self) -> Result<(), Error>;
    fn contains_point(&self, point: &[Self::Scalar]) -> bool;

    // Provided method
    fn aabb(&self) -> ([Self::Scalar; 2], [Self::Scalar; 2]) { ... }
}
Expand description

Trait for boundaries/containers that hold geometries.

Required Associated Types§

Source

type Scalar: RealField + Copy

The coordinate type (f32 or f64).

Required Methods§

Source

fn measure(&self) -> Self::Scalar

Returns the area (2D) or volume (3D) of this boundary.

Source

fn aabb_vec(&self) -> (Vec<Self::Scalar>, Vec<Self::Scalar>)

Returns the axis-aligned bounding box as Vec.

Source

fn validate(&self) -> Result<(), Error>

Validates the boundary and returns an error if invalid.

Source

fn contains_point(&self, point: &[Self::Scalar]) -> bool

Checks if a point is inside the boundary.

Provided Methods§

Source

fn aabb(&self) -> ([Self::Scalar; 2], [Self::Scalar; 2])

Returns the axis-aligned bounding box as (min, max) corners.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§