Foundry Virtual Tabletop - API Documentation - Version 14
    Preparing search index...

    Function polygonCentroid

    • Calculate the centroid non-self-intersecting closed polygon. If the polygon's area is zero, the first point of the polygon is returned, if it has at least on point, otherwise the point {x: 0, y: 0} is returned.

      Parameters

      • points: number[] | Point[]

        The points of the polygon

      Returns Point

      The centroid of the polygon