A Rust library for parsing L3D (Luminaire 3D) files, the 3D geometry format used in the lighting industry alongside GLDF (Global Lighting Data Format).
| Crate | Description | Links |
|---|---|---|
| l3d_rs | Core L3D parser library | |
| l3d-egui | 3D Viewer (Desktop & WASM) | |
| l3d-rs-python | Python bindings |
L3D is a ZIP-based file format containing:
structure.xml- XML file describing the luminaire geometry hierarchy- OBJ files - 3D geometry files for each part of the luminaire
- Optional texture and material files
The format supports hierarchical assemblies with joints, allowing for adjustable luminaire components (e.g., rotatable lamp heads).
[dependencies]
l3d_rs = "0.2"use l3d_rs::from_buffer;
let bytes = std::fs::read("luminaire.l3d").unwrap();
let l3d = from_buffer(&bytes);
for part in &l3d.model.parts {
println!("{} with {} transform", part.path, part.mat.len());
}pip install l3d-rs-pythonimport l3d
data = l3d.from_file("luminaire.l3d")
print(f"Parts: {len(data['model']['parts'])}")Download pre-built binaries from Releases or build from source:
# Native
cargo run -p l3d-egui
# WASM (requires trunk)
cd crates/l3d-egui && trunk serve- XML Parsing: Parse
structure.xmlinto strongly-typed Rust structs - JSON Serialization: Convert between L3D XML and JSON formats
- 3D Model Building: Automatically compute transformation matrices for rendering
- No 3D Engine Dependency: Matrix operations are self-contained (
[f32; 16]) - WASM Compatible: Works in browsers via WebAssembly
- Multi-viewport Viewer: Desktop and web viewer with multi-model support
# Build all crates
cargo build --workspace --release
# Run tests
cargo test --workspace
# Build WASM viewer
cd crates/l3d-egui && trunk build --releaseThis project is licensed under the GPL-3.0-or-later license.
- GLDF - Global Lighting Data Format
- L3D Specification - Official L3D format specification
- gldf-rs - GLDF parser for Rust