A generalization of distinct element method to tridimensional particles with complex shapes