• Parameters

    • graph: FOLD

      a FOLD object

    • indicesToKeep: any = {}

      an object containing: { vertices: [], edges: [], faces: [] } all of which contains a list of indices to keep in the copied graph. the values can be integers or integer-strings, doesn't matter.

    Returns FOLD

    a shallow copy of the graph parameter provided.

    Description

    Create a subgraph from a graph, with shallow pointers to arrays by providing a list of vertices, edges, and faces which will be carried over. This subgraph method is exclusive, meaning, if an edge is carried over but its vertices are not explicitly included, those vertices will not exist, and the edge's edges_vertices entry will be empty. The subgraph component arrays will contain holes, meaning the indices are preserved, making it useful for performing operations on a subgraph, then carrying that information back to the original. If you want to close all holes and remap indices, call normalize().