Thanks to the geometric and material complexity of additive manufacturing, the design space of mechanical parts has been developed, in which lattice filling structure customization can be applied to the solid filling of mechanical parts to achieve the goal of mechanical structure lightweight. A kind of diamond lattice structure unit is designed by imitating the natural method based on Design for Additive Manufacturing of mechanical parts. The mathematical model of the relative density and mechanical properties of the unit are established, and the relationship between the two is obtained, which is verified by simulations; then the relatively uniform results are obtained. The variable density hypothesis of diamond lattice structure is proposed, the methods of simulations and compression tests are used to verify the hypothesis, and the results show that the variable density structure with the density of the filling element decreasing gradually with the stress point as the center has better compression performance and concurrently verify the correctness and applicability of the equivalent modulus of elasticity mathematical model. The results of this study can be applied to the solid sandwich filling of pressure mechanical parts, and the stress density matching relationship can be carried out to further specific design.