Basicly the Geometrie nodes take the imported mesh and turn it into voxels. I did this by creating a 3 dimentional grid and then using the geometrie proximity node to remove every vertice that is outside of the original mesh. On each vertex i am now able to place a lego brick with the instance on points node. I did this once for the normal Lego bricks and again with a three times more dense grid on the z axis to get the result for the thinner Lego plates.
After i got the voxel grids i seperated the vertices from those grids based on the normal of the original shape. Each normal value got a different type of Lego piece. Intersecting pieces also needed to be removed and i added a little bit of a random value to the plates and bricks by replacing some plates with round ones, those grill like Lego tiles or round ones with holes. Afterwards i transfered the vertex color of the original shape to the Lego piece instances and thats it.
Basicly it takes the original mesh and puts it into a grid. With the geometry proximty node i turn the mesh into a voxel grid. That i do once for the big bricks and then for the small plates, which have one third of the height of the normal bricks. Based on the normal of the original mesh i then distriputed the different lego pieces across the grid and everywhere those bricks where placed i remove the base bricks. To phrase it simple if there is a normal of a certain value place this 1x2 slope here and remove the bricks that it intersects with.
currently everything is based on thhe normals. the hollow studs are just random but are placed random at points where tiles and flat plates where suposed to be too keep it a little bit organized. Also right now i dont use the official lego colors because i didnt manage to reduce the color of the shader into the oficcial colors.
When i create the voxel version of the base mesh it is not a filled up version just a hull. Because of the Geometry proximity node it only leaves those vertices that are near the surface of the base mesh so inner vertices will be deleted as well.