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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LdcMesh
impl RefUnwindSafe for LdcMesh
impl Send for LdcMesh
impl Sync for LdcMesh
impl Unpin for LdcMesh
impl UnwindSafe for LdcMesh
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more