The magnetic flux density and the magnetic vector potential produced by a uniform current density or a uniform magnetization inside an arbitrary polyhedron are calculated analytically. The obtained closed-form expressions are remarkably simple and provided in an intrinsic vector form, independently of any reference frame. They are well suited to cope with the data structures, i.e., faces-edges and edges-vertices incidence matrices, provided by unstructured polygonal meshes generators. The expressions obtained contain only elementary functions, and computed results illustrate their effectiveness.