Index: src/Common/NetTopologySuite/Triangulate/NonEncroachingSplitPointFinder.cs
===================================================================
diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a
--- src/Common/NetTopologySuite/Triangulate/NonEncroachingSplitPointFinder.cs (.../NonEncroachingSplitPointFinder.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9)
+++ src/Common/NetTopologySuite/Triangulate/NonEncroachingSplitPointFinder.cs (.../NonEncroachingSplitPointFinder.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a)
@@ -11,6 +11,19 @@
public class NonEncroachingSplitPointFinder : IConstraintSplitPointFinder
{
///
+ /// Computes a split point which is the projection of the encroaching point on the segment
+ ///
+ /// The segment
+ /// The enchroaching point
+ /// A split point on the segment
+ public static ICoordinate ProjectedSplitPoint(Segment seg, ICoordinate encroachPt)
+ {
+ LineSegment lineSeg = seg.LineSegment;
+ ICoordinate projPt = lineSeg.Project(encroachPt);
+ return projPt;
+ }
+
+ ///
/// A basic strategy for finding split points when nothing extra is known about the geometry of
/// the situation.
///
@@ -21,7 +34,7 @@
{
var lineSeg = seg.LineSegment;
var segLen = lineSeg.Length;
- var midPtLen = segLen / 2;
+ var midPtLen = segLen/2;
var splitSeg = new SplitSegment(lineSeg);
var projPt = ProjectedSplitPoint(seg, encroachPt);
@@ -30,9 +43,10 @@
* still encroached upon by the encroaching point (The length is reduced slightly by a
* safety factor)
*/
- var nonEncroachDiam = projPt.Distance(encroachPt) * 2 * 0.8; // .99;
+ var nonEncroachDiam = projPt.Distance(encroachPt)*2*0.8; // .99;
var maxSplitLen = nonEncroachDiam;
- if (maxSplitLen > midPtLen) {
+ if (maxSplitLen > midPtLen)
+ {
maxSplitLen = midPtLen;
}
splitSeg.MinimumLength = maxSplitLen;
@@ -41,18 +55,5 @@
return splitSeg.SplitPoint;
}
-
- ///
- /// Computes a split point which is the projection of the encroaching point on the segment
- ///
- /// The segment
- /// The enchroaching point
- /// A split point on the segment
- public static ICoordinate ProjectedSplitPoint(Segment seg, ICoordinate encroachPt)
- {
- LineSegment lineSeg = seg.LineSegment;
- ICoordinate projPt = lineSeg.Project(encroachPt);
- return projPt;
- }
}
}
\ No newline at end of file