cortex.polyutils.Surface.extract_chunk¶
- Surface.extract_chunk(nfaces=100, seed=None, auxpts=None)[source]¶
Extract a chunk of the surface using breadth-first search, for testing purposes.
Starting from seed (or a random vertex), grows a set of faces by breadth-first traversal of face adjacency until at least nfaces faces have been collected, then returns the sub-mesh induced by those faces with vertex indices remapped to be contiguous.
- Parameters:
- nfacesint, optional
Minimum number of faces to include in the extracted chunk. Default is 100.
- seedint, optional
Vertex index to start the breadth-first search from. If None (default), a random vertex is chosen.
- auxptsndarray, optional
Auxiliary per-vertex data (e.g. an alternate set of point coordinates) to subset and return alongside the chunk.
- Returns:
- ptsndarray
Vertex coordinates of the extracted chunk.
- auxndarray
Corresponding rows of auxpts for the extracted chunk’s vertices. Only returned if auxpts is not None.
- polysndarray
Triangle faces of the extracted chunk, as indices into pts.