unsigned int OEMakeConnectedSurfaceCliques(OESurface &surf)

Assigns a different clique value, starting at 1, to each connected component of the surface. The number of connected components is returned. Listing 2 demonstrates cropping a surface to its largest component.

Listing 2: Extracting the largest portion of the surface

nclqs = oespicoli.OEMakeConnectedSurfaceCliques(surf)

areas = []
for i in range(1, nclqs+1):
    areas.append((oespicoli.OESurfaceCliqueArea(surf, i), i))

maxarea, maxclq = max(areas)
oespicoli.OESurfaceCropToClique(surf, maxclq)