Documentation / @ripl/terminal / isPointInContours
Function: isPointInContours() ​
isPointInContours(
contours,x,y,fillRule?):boolean
Defined in: terminal/src/hit.ts:39
Tests whether a point falls inside one or more closed contours.
Crossings are counted with a half-open edge test, so a vertex shared by two edges is counted once. evenodd alternates inside and outside on every crossing; nonzero accumulates the winding direction, so nested contours wound the same way stay filled.
Parameters ​
| Parameter | Type | Default value | Description |
|---|---|---|---|
contours | Vertex[][] | undefined | The contours to test against, implicitly closed. |
x | number | undefined | X coordinate of the point. |
y | number | undefined | Y coordinate of the point. |
fillRule | FillRule | 'nonzero' | The fill rule to apply. Defaults to nonzero, as canvas does. |
Returns ​
boolean
true when the point is inside.