Index: src/Common/NetTopologySuite/Noding/IntersectionFinderAdder.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- src/Common/NetTopologySuite/Noding/IntersectionFinderAdder.cs (.../IntersectionFinderAdder.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ src/Common/NetTopologySuite/Noding/IntersectionFinderAdder.cs (.../IntersectionFinderAdder.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -11,8 +11,8 @@ /// public class IntersectionFinderAdder : ISegmentIntersector { - private LineIntersector li = null; private readonly IList interiorIntersections = null; + private readonly LineIntersector li = null; /// /// Creates an intersection finder which finds all proper intersections. @@ -34,7 +34,7 @@ return interiorIntersections; } } - + /// /// This method is called by clients /// of the class to process @@ -47,29 +47,33 @@ /// /// /// - public void ProcessIntersections(SegmentString e0, int segIndex0, SegmentString e1, int segIndex1 ) + public void ProcessIntersections(SegmentString e0, int segIndex0, SegmentString e1, int segIndex1) { // don't bother intersecting a segment with itself - if (e0 == e1 && segIndex0 == segIndex1) + if (e0 == e1 && segIndex0 == segIndex1) + { return; + } ICoordinate p00 = e0.Coordinates[segIndex0]; ICoordinate p01 = e0.Coordinates[segIndex0 + 1]; ICoordinate p10 = e1.Coordinates[segIndex1]; ICoordinate p11 = e1.Coordinates[segIndex1 + 1]; - li.ComputeIntersection(p00, p01, p10, p11); + li.ComputeIntersection(p00, p01, p10, p11); if (li.HasIntersection) { if (li.IsInteriorIntersection()) { - for(int intIndex = 0; intIndex < li.IntersectionNum; intIndex++) + for (int intIndex = 0; intIndex < li.IntersectionNum; intIndex++) + { interiorIntersections.Add(li.GetIntersection(intIndex)); - + } + e0.AddIntersections(li, segIndex0, 0); e1.AddIntersections(li, segIndex1, 1); } } } } -} +} \ No newline at end of file