Project Overview
This Houdini project converts any faceted mesh to a collection of LEGO pieces. The project uses a variety of LEGO pieces and exposes various parameters to the user so that they can tweak the final LEGO assembly. 
My Contribution
The project essentially works by isolating the particles at the top of the mesh surface.  Then, we identify the particles where the surface normal is 'sufficiently different' than a certain user-provided threshold. These blocks are then oriented by applying a normal-aware rotation. Next, I look at all the remaining top points, and place 2x1x1 grill blocks wherever possible. All the particles that result in intersecting blocks are discarded. We then try to place 2x1x2 on all the 'non-top' particles, as well as the particles discarded in the previous step. This also uses the intersection logic similar to the previous step, and rejects all non-conforming particles.  All the remaining positions are tried to be filled with 2x1x1 blocks with the similar intersection logic as before. Finally, all the remaining particles end up with 1x1x1 blocks placed on top of them. You can view the project files here. 
Back to Top