private ICurve OrientPolyline(Polyline polyline, bool clockwise) { bool isClockwise = IsClockwise(polyline); if (isClockwise == clockwise) { return(polyline); } return(polyline.Reverse()); }
public static Polyline PolylineAroundClosedCurve(ICurve curve) { Polyline poly = new Polyline(); foreach (Point point in PointsOnAroundPolyline(curve)) { poly.AddPoint(point); } if (Point.GetTriangleOrientation(poly.StartPoint.Point, poly.StartPoint.Next.Point, poly.StartPoint.Next.Next.Point) == TriangleOrientation.Counterclockwise) { poly = (Polyline)poly.Reverse(); } poly.Closed = true; return(poly); }
private ICurve OrientPolyline(Polyline polyline, bool clockwise) { bool isClockwise = IsClockwise(polyline); if (isClockwise == clockwise) return polyline; return polyline.Reverse(); }