We introduce a multi-dimensional generalization of the Euclidean algorithm and show how it is related to digital geometry and especially to the generation and recognition of digital planes. We show how to associate with the steps of the algorithm geometrical extensions of substitutions, i.e., rules that replace faces by unions of faces, to build finite sets called patterns. We examine several of their combinatorial, geometrical and topological properties. This work is a first step towards the incremental computation of patterns that locally fit a digital surface for the accurate approximation of tangent planes.