About the Project

Inspiration

I wanted to solve a very practical maker problem: there are tons of cool 3D models online, but turning them into something physically buildable with LEGO is still painful. Most workflows are fragmented, command-line heavy, or require manual cleanup.

The core idea was simple: make a clean web interface that converts an OBJ model into LDR output, with previews on both sides.

How I Built It

I built an end-to-end OBJ-to-LDR pipeline with a lightweight web UI:

  1. Input a 3D mesh (.obj)
  2. Normalize geometry and voxelize the mesh
  3. Convert occupied voxels into LEGO-style brick placements
  4. Optionally merge neighboring bricks to reduce part count
  5. Export an .ldr file and preview both source and output

Tech stack:

  • Python for the conversion pipeline
  • trimesh + numpy/scipy for mesh and voxel processing
  • Streamlit for the interface
  • Plotly for interactive browser previews
  • GitHub + Streamlit Community Cloud for deployment

What I Learned

This project taught me how to balance geometry fidelity with practical buildability:

  • Lower pitch gives more detail but increases part count and compute cost
  • Higher pitch runs faster but loses shape detail
  • Good UX is as important as the algorithm itself

A useful rule of thumb from voxelization is:

$$ N_{voxels} \propto \frac{1}{p^3} $$

where $p$ is voxel pitch. Reducing pitch even slightly can dramatically increase model complexity.

Challenges I Faced

  1. Cloud dependency compatibility
  2. Streamlit Cloud used Python 3.14, while open3d did not have compatible wheels there.
  3. I removed open3d as a hard dependency and made viewer behavior degrade gracefully.

  4. Keeping the interface simple under hackathon pressure

  5. Early versions had too many controls.

  6. I redesigned the app to keep one clear Generate flow with dual previews.

  7. Large model handling

  8. Some OBJ files were large, affecting both rendering and repository size.

  9. I had to keep previews responsive and watch file-size constraints.

  10. Deployment reliability

  11. Local and cloud behavior differed.

  12. I added safer defaults and better guardrails so the app remains stable online.

Why This Project Matters

This project bridges digital creativity and physical making.

Instead of stopping at a 3D mesh, creators can quickly move toward a buildable LEGO representation through a workflow that is visual, simple, and practical for rapid iteration.

Built With

Share this project:

Updates