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 ⊂ R d , we consider the closure of the complement of K in the d-sphere M K = S d \ K . For a base-point x in the boundary ∂ M K of the manifold M K one can attempt to determine, from the point cloud X , the induced homomorphism of fundamental groups φ : π 1 (∂ M K , x) → π 1 (M K , x) in the category of finitely presented groups. We illustrate a computer implementation for K a small closed tubular neigh-P.D. 123 28 P. Brendel et al.bourhood of a tame knot in R 3 . In this case the homomorphism φ is known to be a complete ambient isotopy invariant of the knot. We observe that low-index subgroups of finitely presented groups provide useful invariants of φ. In particular, the first integral homology of subgroups G < π 1 (M K ) of index at most six suffices to distinguish between all prime knots with 11 or fewer crossings (ignoring chirality). We plan to provide formal time estimates for our algorithm and characteristics of a high performance C++ implementation in a subsequent paper. The prototype computer implementation of the present paper has been written in the interpreted gap programming language for computational algebra.