• Parameters

    • graph: FOLD

      a FOLD object

    • Optional epsilon: number = EPSILON

      an optional epsilon

    • Optional makeAverage: boolean = true

      an optional request, should the merged vertex be a geometric average of all vertices which went into it?

      • if "true", average will be calculated
      • if "false", the smallest vertex index in the cluster is used

    Returns {
        map: number[];
        remove: number[];
    }

    summary of changes

    • map: number[]
    • remove: number[]

    Description

    This will shrink the number of vertices in the graph, if vertices are close within an epsilon, it will keep the first one, find the average of close points, and assign it to the remaining vertex. this has the potential to create circular and duplicate edges. Important note: if vertices are mismatched in dimension (2D and 3D), this might treat all vertices as 2D and duplicate vertices will be declared when they are actually not the same. Just make sure your graph's vertices are all of the same dimension.