We describe an algorithm for computing a finite, and typically small, presentation of the fundamental group of a finite regular CW-space. The algorithm is based on the construction of a discrete vector field on the 3-skeleton of the space. A variant yields the homomorphism of fundamental groups induced by a cellular map of spaces. We illustrate how the algorithm can be used to infer information about the fundamental group π1(K) of a metric space K using only a finite point cloud X sampled from the space. In the special case where K is a d-dimensional compact manifold K ⊂ Rd , we consider the closure of the complement of K in the d-sphere MK = Sd \ K. For a base-point x in the boundary ∂MK of the manifold MK one can attempt to determine, from the point cloud X, the induced homomorphism of fundamental groups φ: π1(∂MK, x) → π1(MK, x) in the category of finitely presented groups. We illustrate a computer implementation for K a small closed tubular neighbourhood of a tame ...