We show that at any point the gravity field from a solid body bounded by plane surfaces and having uniform density can be computed as a field from a fictitious distribution of surface mass-density on the same body. The surface mass density at every surface element is equal to the product of the volume density of the body and the scalar product of (1) the unit outward vector normal to that surface element and (2) the position vector of the surface element with respect to the point of observation. Accordingly, the contribution to the gravity field from any plane surface of the body vanishes if the observation point lies in the plane of that surface. As a result, we can compute the gravity field everywhere, including points inside, on the surface, on an edge, or at a corner of the body where more than two surfaces meet.
This new result lets us compute the gravity field using exactly the same simple procedure as for the magnetic field of a uniformly magnetized object, computed from an equivalent surface distribution of magnetic pole density. To get the gravity field while computing the magnetic field, one simply uses the product of this surface mass density and the universal gravitational constant instead of the surface magnetic pole density. Therefore, the same computer program can be used to compute the gravity, the magnetic field, or both simultaneously. This simple and novel approach makes the numerical computations much faster than all other previously published schemes.