testXYPolygonTurningDirections MethodStatic
Test the direction of turn at the vertices of the polygon, ignoring z-coordinates.
- For a polygon without self-intersections and successive colinear edges, this is a convexity and orientation test: all positive is convex and counterclockwise, all negative is convex and clockwise.
- Beware that a polygon which turns through more than a full turn can cross itself and close, but is not convex.
testXYPolygonTurningDirections(points: Point3d[] | Point2d[]): number
@returns 1 if all turns are to the left, -1 if all to the right, and 0 if there are any zero or reverse turns
Parameter | Type | Description |
---|---|---|
points | Point3d[] | Point2d[] |
Returns - number
1 if all turns are to the left, -1 if all to the right, and 0 if there are any zero or reverse turns
Defined in
- geometry3d/PolygonOps.ts Line 712
Last Updated: 14 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.