convexBarycentricCoordinates MethodStatic

Compute the barycentric coordinates for a point inside a convex polygon.

convexBarycentricCoordinates(polygon: IndexedXYZCollection | Point3d[], point: Point3d, tolerance: numberGeometry.smallMetricDistance): undefined | number[]

@returns barycentric coordinates of the interior point, or undefined if invalid polygon or exterior point. Length is same as polygon.length.

@see pointToFraction

Parameter Type Description
polygon IndexedXYZCollection | Point3d[] points of the polygon, assumed to be convex. Closure point optional.
point Point3d point assumed to be inside or on polygon
tolerance number distance tolerance for point to be considered on a polygon edge

Returns - undefined | number[]

barycentric coordinates of the interior point, or undefined if invalid polygon or exterior point. Length is same as polygon.length.

Defined in

Last Updated: 17 May, 2024