Skip to main content

Crate eulumdat_goniosim

Crate eulumdat_goniosim 

Source
Expand description

eulumdat-goniosim — CPU Monte Carlo photon tracer for virtual goniophotometry.

Pure Rust crate for tracing photons through luminaire geometry and collecting them on a virtual goniophotometer sphere. This is the reference implementation that produces numerically correct results. Any future GPU tracer must validate against it.

§Two-Layer Material System

Users work with MaterialParams using manufacturer datasheet values (reflectance %, IOR, transmittance %, thickness, diffusion %). The tracer converts them to internal physics representations automatically.

§Example

use eulumdat_goniosim::*;

// Build a scene: LED + white housing + opal PMMA cover
let scene = SceneBuilder::new()
    .source(Source::Led {
        position: nalgebra::Point3::origin(),
        direction: nalgebra::Unit::new_unchecked(
            nalgebra::Vector3::new(0.0, 0.0, -1.0),
        ),
        half_angle_deg: 60.0,
        flux_lm: 1000.0,
    })
    .reflector(catalog::white_paint(), ReflectorPlacement {
        distance_mm: 25.0,
        length_mm: 50.0,
        side: ReflectorSide::Surround,
    })
    .cover(catalog::opal_pmma_3mm(), CoverPlacement {
        distance_mm: 40.0,
        width_mm: 60.0,
        height_mm: 60.0,
    })
    .build();

// Trace 1M photons
let config = TracerConfig {
    num_photons: 1_000_000,
    ..TracerConfig::default()
};
let result = Tracer::trace(&scene, &config);

// Export to EULUMDAT
let ldt = detector_to_eulumdat(
    &result.detector,
    1000.0,
    &ExportConfig::default(),
);
let ldt_string = ldt.to_ldt();

Re-exports§

pub use catalog::material_catalog;
pub use detector::Detector;
pub use export::detector_to_eulumdat;
pub use export::detector_to_eulumdat_at_angles;
pub use export::detector_to_eulumdat_with_lamp_flux;
pub use export::ExportConfig;
pub use geometry::Primitive;
pub use geometry::SceneObject;
pub use material::Interaction;
pub use material::Material;
pub use material::MaterialParams;
pub use ray::HitRecord;
pub use ray::Photon;
pub use ray::Ray;
pub use scene::bare_isotropic;
pub use scene::bare_lambertian;
pub use scene::led_housing_with_cover;
pub use scene::led_with_housing;
pub use scene::roundtrip_validation;
pub use scene::CoverPlacement;
pub use scene::ReflectorPlacement;
pub use scene::ReflectorSide;
pub use scene::Scene;
pub use scene::SceneBuilder;
pub use source::Source;
pub use tracer::PhotonTrail;
pub use tracer::ProgressInfo;
pub use tracer::Tracer;
pub use tracer::TracerConfig;
pub use tracer::TracerResult;
pub use tracer::TracerStats;
pub use tracer::TrailEvent;
pub use tracer::TrailPoint;
pub use nalgebra;
pub use rand;
pub use rand_xoshiro;

Modules§

catalog
Material catalog with common materials and their datasheet values.
detector
Spherical goniophotometer detector for photon collection and binning.
export
Convert detector output to Eulumdat struct for .ldt/.ies export.
geometry
Scene geometry primitives with exact ray intersection.
material
Two-layer material system: user-facing MaterialParams and internal Material.
ray
Ray, hit record, and photon types for Monte Carlo tracing.
scene
Scene description and builder for luminaire simulation.
source
Photon emission source models.
tracer
Monte Carlo photon tracer.

Type Aliases§

MaterialId
Material index type.