We derive explicit, closed-form expressions describing elastic and piezoelectric deformations due to polyhedral inclusions in uniform half-space and bi-materials. Our analysis is based on the linear elasticity theory and Green's function method. The method involves evaluation of volume and surface integrals of harmonic and bi-harmonic potentials. In case of polyhedra, such integrals are expressed through algebraic functions. Our results generalize numerous studies on this subject, and they allow to obtain fully analytical solutions for a number of physical and engineering problems. In the limiting case of an infinite space, our relations have an essentially more compact form, than relations obtained by other authors. We present solutions to classical Mindlin and Cherruti problems. We describe the elastic relaxation of a misfitting polygonal quantum dot in bi-materials assuming isotropic and vertically isotropic properties. It is explained how to analyze nonhydrostatic and non-uniform inclusions. We also study piezoelectric fields induced by inclusions in materials with cubic and hexagonal lattices. Among other results, we have found that a cubic inclusion in an isotropic material reproduces fields of quantum dots in GaAs (0, 0, 1) and GaAs (1, 1, 1) depending on the orientation of the cube. This suggests that one can qualitatively model crystals with different lattices by choosing an appropriate inclusion shape.