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: usizeNumber of C-plane divisions
g_divisions: usizeNumber of gamma divisions
Implementations§
Source§impl LdcMesh
impl LdcMesh
Sourcepub fn from_photweb(
web: &PhotometricWeb,
c_step: f64,
g_step: f64,
scale: f32,
) -> Self
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 fromc_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 degreesscale- 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
Sourcepub fn positions_flat(&self) -> Vec<f32>
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.
Sourcepub fn normals_flat(&self) -> Vec<f32>
pub fn normals_flat(&self) -> Vec<f32>
Get vertex normals as a flat array [nx0, ny0, nz0, nx1, ny1, nz1, …].
Sourcepub fn triangle_count(&self) -> usize
pub fn triangle_count(&self) -> usize
Get the number of triangles in the mesh.
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
Get the number of vertices in the mesh.
Sourcepub fn generate_colors(
&self,
web: &PhotometricWeb,
c_step: f64,
g_step: f64,
mode: ColorMode,
) -> Vec<Color>
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.
Sourcepub fn colors_flat(colors: &[Color]) -> Vec<f32>
pub fn colors_flat(colors: &[Color]) -> Vec<f32>
Get colors as a flat RGBA array [r0, g0, b0, a0, r1, g1, b1, a1, …]