clipPolygonByHalfPlane()
function clipPolygonByHalfPlane(
polygon,
boundaryPoint,
inwardNormal
): Point[];
Defined in: packages/core/src/geometry/voronoi.ts:28
Sutherland–Hodgman clip of a convex polygon against one half-plane: the
boundary line passes through boundaryPoint perpendicular to
inwardNormal, and points on the inwardNormal side are kept. Exported
directly (not just as a voronoi.ts internal) since it's the reusable
primitive computeVoronoiCells repeatedly applies per site pair, and it's
independently testable without a full multi-site setup.
Parameters
| Parameter | Type |
|---|---|
polygon | readonly Point[] |
boundaryPoint | Point |
inwardNormal | Point |
Returns
Point[]