• Parameters

    • graph: FOLD

      a FOLD object

    • point: [number, number]

      the point to test

    • Optional vector: [number, number]

      an optional vector, used in the case that the point exists along an edge or a vertex.

    Returns number

    the index of a face, or undefined if the point does not lie inside any face.

    Description

    Given a point, get the index of a face that this point exists within. In the case when the point lies along an edge or vertex, an additional vector parameter can be used to nudge the point by a very tiny amount, then there will be a preference to return the index of the face which encloses the nudged point. This is a 2D-only method, any z-axis data will be ignored.