Shape3D

Trait Shape3D 

Source
pub trait Shape3D {
    // Required method
    fn shape(&self) -> (usize, usize, usize);
}
Expand description

Trait for 3D structures that have dimensions.

This trait provides a uniform interface for querying the dimensions of 3D volumes and meshes.

§Example

use shortestpath::mesh_3d::{Shape3D, Full3D};

let mesh = Full3D::new(10, 8, 5);
let (width, height, depth) = mesh.shape();
assert_eq!(width, 10);
assert_eq!(height, 8);
assert_eq!(depth, 5);

Required Methods§

Source

fn shape(&self) -> (usize, usize, usize)

Returns the dimensions of this 3D structure.

§Returns

A tuple (width, height, depth) representing the dimensions

Implementors§