We present a new 3D gravity-inversion approach that retrieves the geometry of an isolated geologic source with known density contrast and depth of the top. We approximate the source by an interpretation model formed by an ensemble of vertically juxtaposed right prisms whose horizontal cross-sections are described by unknown polygons. The vertices of the polygon of each prism are described by polar coordinates with an unknown origin within the prism. Our method estimates the radii associated with the vertices of each polygon and the horizontal Cartesian coordinates of the unknown origin. The depth of the bottom of the interpretation model is estimated by a new criterion based on the curve of the estimated total-anomalous mass versus the data-misfit measure. Applications to both synthetic and field data sets show that our method obtains stable solutions that recover the geometry of the 3D source and fit the data, even in the case of a complex simulated body with variable dips and strikes. Our method has the advantage of requiring no constraints favoring homogeneity and compactness, which makes it operationally simple.