public void PrepareSegments() { Segments.ForEach(s => s.IsClipped = s.GetIsClipped(TopLeft, BottomRight) && !s.IsOutline); if (_clipping) { Segments.RemoveAll(s => s.IsClipped); } DoMergeCollinearSegments(); SplitSegmentsThatOverlap(); EndPoints.AddRange(Segments.Select(vs => vs.Start)); EndPoints.AddRange(Segments.Select(vs => vs.End)); DebugDrawSegments(); }