pub trait Layout3d {
const PIXEL_COUNT: usize;
// Required method
fn shapes() -> impl Iterator<Item = Shape3d>;
// Provided method
fn points() -> impl Iterator<Item = Vec3> { ... }
}
Expand description
Trait for three-dimensional LED layouts.
Implementors of this trait represent a 3D arrangement of LEDs using one or more shapes.
Use layout3d!
to define a type that implements Layout3d
.
For our 3D space, we can think of:
(-1.0, -1.0, -1.0)
as the left bottom back(-1.0, -1.0, 1.0)
as the left bottom front(1.0, -1.0, -1.0)
as the right bottom back(1.0, -1.0, 1.0)
as the right bottom front(-1.0, 1.0, -1.0)
as the left top back(-1.0, 1.0, 1.0)
as the left top front(1.0, 1.0, -1.0)
as the right top back(1.0, 1.0, 1.0)
as the right top front
Required Associated Constants§
Sourceconst PIXEL_COUNT: usize
const PIXEL_COUNT: usize
The total number of LEDs in this layout.
Required Methods§
Provided Methods§
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.