G-Shark is a free and open-source geometry library designed for computational designers and software developers in the Architecture, Engineering, and Construction (AEC) industry.
public static bool IsClockwise(IList<Point3> points)
{
double sum = 0;
for (int i = 0; i < points.Count - 1; i++)
{
sum += (points[i + 1].X - points[i].X) * (points[i + 1].Y + points[i].Y);
if (sum == 0.0)
{
throw new ArgumentException("The points are on a straight line or are creating a closed loop.");
}
return sum > 0;
}
public static bool IsClockwise(IList<Point3> points, Plane pl)
{
var projectedPts = points.Select(pt => pl.ClosestPoint(pt, out _)).ToList();
return IsClockwise(projectedPts);
}
https://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-points-are-in-clockwise-order.