Converting a mesh to a voxel

Is there anyone who managed to create a component to convert a mesh to its voxel representation?