1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//! 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
//!
//! ```rust,no_run
//! 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();
//! ```
/// Material index type.
pub type MaterialId = usize;
// Re-export dependencies for downstream crates (e.g. eulumdat-wasm)
pub use nalgebra;
pub use rand;
pub use rand_xoshiro;
// Re-exports for convenience
pub use material_catalog;
pub use Detector;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use Source;
pub use ;