Connectivity algorithms can be implemented using a recursive visit method, that is, begin by choosing an arbitrary cell and mark it "visited". Then, depending upon the type of connectivity desired, we gather the appropriate neighbors and mark them visited. We generally refer to such a set of connected cells as a connected "surface" even though the cells may be of a topological dimension other than two.
To identify additional connected surfaces we locate another unvisited
cell and repeat the processes described previously. We continue to identify
connected surfaces until every cell in the dataset is visited. As each
connectd surface is identified, it is asied a surface number: We can use
this number to specify the surfaces to exract or we can specify "speed"
points or cells and extract the surfaces connected to them.