LdcMesh

Struct LdcMesh 

Source
pub struct LdcMesh {
    pub vertices: Vec<Vertex>,
    pub indices: Vec<u32>,
    pub c_divisions: usize,
    pub g_divisions: usize,
}
Expand description

A 3D mesh representing the LDC (Luminous Distribution Curve) solid.

This is the “photometric solid” - a 3D surface where distance from center equals intensity at that angle.

Fields§

§vertices: Vec<Vertex>

Vertex positions and normals

§indices: Vec<u32>

Triangle indices (3 per triangle)

§c_divisions: usize

Number of C-plane divisions

§g_divisions: usize

Number of gamma divisions

Implementations§

Source§

impl LdcMesh

Source

pub fn from_photweb( web: &PhotometricWeb, c_step: f64, g_step: f64, scale: f32, ) -> Self

Generate an LDC solid mesh from a PhotometricWeb.

§Arguments
  • web - The photometric web to generate from
  • c_step - Angle step for C-planes in degrees (e.g., 5.0 for smooth, 15.0 for fast)
  • g_step - Angle step for gamma in degrees
  • scale - Scale factor for the mesh (1.0 = normalized intensity as radius)
§Coordinate System
  • Y axis points up (nadir at -Y, zenith at +Y)
  • X-Z plane is horizontal
  • C=0° is along +Z axis, C=90° is along +X axis
Source

pub fn positions_flat(&self) -> Vec<f32>

Get vertex positions as a flat array [x0, y0, z0, x1, y1, z1, …].

Useful for graphics APIs that expect interleaved or separate position data.

Source

pub fn normals_flat(&self) -> Vec<f32>

Get vertex normals as a flat array [nx0, ny0, nz0, nx1, ny1, nz1, …].

Source

pub fn triangle_count(&self) -> usize

Get the number of triangles in the mesh.

Source

pub fn vertex_count(&self) -> usize

Get the number of vertices in the mesh.

Source

pub fn generate_colors( &self, web: &PhotometricWeb, c_step: f64, g_step: f64, mode: ColorMode, ) -> Vec<Color>

Generate per-vertex colors based on mode.

Uses the photometric web to sample intensity at each vertex’s angle.

Source

pub fn colors_flat(colors: &[Color]) -> Vec<f32>

Get colors as a flat RGBA array [r0, g0, b0, a0, r1, g1, b1, a1, …]

Trait Implementations§

Source§

impl Clone for LdcMesh

Source§

fn clone(&self) -> LdcMesh

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LdcMesh

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.