In this paper, we consider the problem of analysing the shape of an object defined by polynomial equations in a domain. We describe regularity criteria which allow us to determine the topology of the implicit object in a box from information on the boundary of this box. Such criteria are given for planar and space algebraic curves and for algebraic surfaces. These tests are used in subdivision methods in order to produce a polygonal approximation of the algebraic curves or surfaces, even if it contains singular points. We exploit the representation of polynomials in Bernstein basis to check these criteria and to compute the intersection of edges or facets of the box with these curves or surfaces. Our treatment of singularities exploits results from singularity theory such as an explicit Whitney stratification or the local conic structure around singularities. A few examples illustrate the behavior of the algorithms.