We present a gravity-inversion method for estimating the geometry of 3D sources, assuming prior knowledge about its top and density contrast. The subsurface region containing the geologic sources is discretized into an ensemble of 3D vertical, juxtaposed prisms in the vertical direction of a right-handed coordinate system. The prisms’ thicknesses and density contrasts are known, but their horizontal cross-sections are described by an unknown polygon. The horizontal coordinates of the polygon vertices approximately represent the edges of horizontal depth slices of the 3D geologic source. The polygon vertices 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 for a fixed number of equally spaced angles from 0o to 360o and the horizontal Cartesian coordinates of the unknown origin. By estimating these parameters from gravity data, we retrieve a set of vertically stacked prisms with polygonal horizontal sections that represents a set of juxtaposed horizontal depth slices of the estimated source and approximates the 3D source's geometry. To obtain stable estimates we impose constraints on the source shape. The judicious use of first-order Tikhonov regularization on either all or a few parameters allows estimating both vertical and inclined sources whose shapes can be isometric or anisometric. The estimated solution, despite being stable and fitting the data, will depend on the maximum depth assumed for the set of juxtaposed 3D prisms. To reduce the class of possible solutions compatible with the gravity anomaly and the constraints, we use the criterion based on data-misfit measure and the estimated total-anomalous mass computed along successive inversions that use different tentative maximum depths for the set of assumed juxtaposed 3D prisms. In this criterion we plotted the curve of estimated total-anomalous mass w versus data-misfit measures for the range of different tentative maximum depths considered. The tentative value for the maximum depth producing the smallest value of data-misfit measure in the curve w x s is the best estimate of the true (or minimum) depth to the bottom of the source, depending on whether the true source produces a gravity anomaly that is able (or unable) to resolve it. This criterion was deduced theoretically from Gauss’ theorem. Our tests with synthetic data shows that the correct depth-to-bottom estimate of the source is obtained if the smallest value of s on the curve w x s is well-defined; otherwise this criterion provides the lower bound estimate of the bottom's depth of the source. Our tests using synthetic data show that the method efficiently recovers source geometries dipping at different angles. We applied our method to real data from the Redenção granite (Brazil) and from the Matsitama intrusive complex (Botswana). In the first case, our method estimates a granite with nearly conical shape and with maximum bottom depth of 7.0 ± 0.5 km. In the second case, our method retrieves a dipping intrusion with variable dips and strikes and with maximum bottom depth of 8.0 ± 0.5 km.