devela/num/geom/shape/extent/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// devela::num::geom::shape::extent
//
//! A geometrical extent.
//

mod impl_traits;
mod methods;

/// An orthogonal extension in `D`-space without a coordinate position.
///
/// Represents the lengths of each dimension in a multi-dimensional space,
/// providing an origin-agnostic shape with the implied form of an orthotope
/// (generalized rectangle or box).
#[must_use]
#[repr(transparent)]
pub struct Extent<T, const D: usize> {
    /// The D-dimensional extent.
    extent: [T; D],
}

/// A 2-dimensional [`Extent`].
pub type Extent2d<T> = Extent<T, 2>;

/// A 3-dimensional [`Extent`].
pub type Extent3d<T> = Extent<T, 3>;