Skip to content

holg/l3d_rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

l3d-rs

Crates.io Documentation CI PyPI License: GPL-3.0

A Rust library for parsing L3D (Luminaire 3D) files, the 3D geometry format used in the lighting industry alongside GLDF (Global Lighting Data Format).

Workspace Crates

Crate Description Links
l3d_rs Core L3D parser library crates.io
l3d-egui 3D Viewer (Desktop & WASM) crates.io
l3d-rs-python Python bindings PyPI

What is L3D?

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).

Quick Start

Rust

[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());
}

Python

pip install l3d-rs-python
import l3d

data = l3d.from_file("luminaire.l3d")
print(f"Parts: {len(data['model']['parts'])}")

3D Viewer

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

Features

  • XML Parsing: Parse structure.xml into 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

Building

# Build all crates
cargo build --workspace --release

# Run tests
cargo test --workspace

# Build WASM viewer
cd crates/l3d-egui && trunk build --release

License

This project is licensed under the GPL-3.0-or-later license.

Related Projects

About

The Rust Library for reading l3d files (https://github.com/globallightingdata/l3d)

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors