src/Elements/Geometry/Polyline.cs
/// <summary>
/// Check for self-intersection in the supplied line segment collection.
/// </summary>
/// <param name="t">The transform representing the plane of the polygon.</param>
/// <param name="segments"></param>
Check for self-intersection in the supplied line segment collection.
Check for self - intersection in the supplied line segment collection .
internal static void CheckSelfIntersectionAndThrow(Transform t, IList<Line> segments)
        {
            var segmentsTrans = new List<Line>();
            foreach (var l in segments)
            {
                segmentsTrans.Add(t.OfLine(l));
            };
            for (var i = 0; i < segmentsTrans.Count; i++)
            {
                for (var j = 0; j < segmentsTrans.Count; j++)
                {
                    if (i == j)
                    {
                        continue;
                    }
                    if (segmentsTrans[i].Intersects2D(segmentsTrans[j]))
                    {
                        throw new ArgumentException($"The polyline could not be created. Segments {i} and {j} intersect.");
                    }
                }
            }
        }
internal static void CheckSelfIntersectionAndThrow ( Transform t , IList < Line > segments ) { var segmentsTrans = new List < Line > ( ) ; foreach ( var l in segments ) { segmentsTrans . Add ( t . OfLine ( l ) ) ; } ; for ( var i = 0 ; i < segmentsTrans . Count ; i ++ ) { for ( var j = 0 ; j < segmentsTrans . Count ; j ++ ) { if ( i == j ) { continue ; } if ( segmentsTrans [ i ] . Intersects2D ( segmentsTrans [ j ] ) ) { throw new ArgumentException ( $" The polyline could not be created. Segments  { i }  and  { j }  intersect. " ) ; } } } }
Check for self-intersection in the supplied line segment collection.
Check for self - intersection in the supplied line segment collection .
// Don't check against itself.
t
Transform
The transform representing the plane of the polygon.
The transform representing the plane of the polygon .
segments
IList<Line>
None