convexBarycentricCoordinates MethodStatic

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

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

see BarycentricTriangle.pointToFraction

Parameter Type Description
polygon Point3d[] | IndexedXYZCollection 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: 20 June, 2023