Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryGenerator.cs =================================================================== diff -u -r6538 -r7042 --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryGenerator.cs (.../GeometryGenerator.cs) (revision 6538) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryGenerator.cs (.../GeometryGenerator.cs) (revision 7042) @@ -150,12 +150,12 @@ double distance2 = Routines2D.CalculateDistanceToLine(point2.X, point2.Z, line.HeadPoint.X, line.HeadPoint.Z, line.EndPoint.X, line.EndPoint.Z); - if (distance1 > distance2 && distance1 > GeometryConstants.Accuracy) + if (distance1 > distance2 && distance1 > GeometryConstants.Tolerance) { isPoint1ClosestToLine = false; } - if (distance1 < distance2 && distance2 > GeometryConstants.Accuracy) + if (distance1 < distance2 && distance2 > GeometryConstants.Tolerance) { isPoint2ClosestToLine = false; } @@ -179,10 +179,10 @@ Point2D localPoint3 = line2.HeadPoint; Point2D localPoint4 = line2.EndPoint; - bool isPoint3OnLine1 = Routines2D.DoesPointExistInLine(localPoint1, localPoint2, localPoint3, GeometryConstants.Accuracy); - bool isPoint4OnLine1 = Routines2D.DoesPointExistInLine(localPoint1, localPoint2, localPoint4, GeometryConstants.Accuracy); - bool isPoint1OnLine2 = Routines2D.DoesPointExistInLine(localPoint3, localPoint4, localPoint1, GeometryConstants.Accuracy); - bool isPoint2OnLine2 = Routines2D.DoesPointExistInLine(localPoint3, localPoint4, localPoint2, GeometryConstants.Accuracy); + bool isPoint3OnLine1 = Routines2D.DoesPointExistInLine(localPoint1, localPoint2, localPoint3, GeometryConstants.Tolerance); + bool isPoint4OnLine1 = Routines2D.DoesPointExistInLine(localPoint1, localPoint2, localPoint4, GeometryConstants.Tolerance); + bool isPoint1OnLine2 = Routines2D.DoesPointExistInLine(localPoint3, localPoint4, localPoint1, GeometryConstants.Tolerance); + bool isPoint2OnLine2 = Routines2D.DoesPointExistInLine(localPoint3, localPoint4, localPoint2, GeometryConstants.Tolerance); bool isPoint1SameAsPoint3 = localPoint1.LocationEquals(localPoint3); bool isPoint1SameAsPoint4 = localPoint1.LocationEquals(localPoint4); bool isPoint2SameAsPoint3 = localPoint2.LocationEquals(localPoint3); @@ -1154,7 +1154,7 @@ /// /// Regenerates all the curves that have intersections. /// Find all intersections between curves and split them at the intersection points, adding curves where needed. - /// Find all parallel curves and split them at the intersection pointss, adding curves where needed. + /// Find all parallel curves and split them at the intersection points, adding curves where needed. /// At the end, clean up the points and curves. /// private void RegenerateAllCurvesIntersection() @@ -1204,9 +1204,9 @@ out Point2D intersectionPoint) == LineIntersection.Intersects) { if (!Routines2D.DetermineIfPointsCoincide(geometryCurve1HeadPoint.X, geometryCurve1HeadPoint.Z, intersectionPoint.X, - intersectionPoint.Z, 0.001) + intersectionPoint.Z, GeometryConstants.Tolerance) && !Routines2D.DetermineIfPointsCoincide(geometryCurve1EndPoint.X, geometryCurve1EndPoint.Z, intersectionPoint.X, - intersectionPoint.Z, 0.001)) + intersectionPoint.Z, GeometryConstants.Tolerance)) { Point2D point = geometryData.CreatePointAndAddItToTheProperListsWhenNeeded(new Point2D(intersectionPoint.X, intersectionPoint.Z)); @@ -1215,9 +1215,9 @@ } if (!Routines2D.DetermineIfPointsCoincide(geometryCurve2HeadPoint.X, geometryCurve2HeadPoint.Z, intersectionPoint.X, - intersectionPoint.Z, 0.001) && + intersectionPoint.Z, GeometryConstants.Tolerance) && !Routines2D.DetermineIfPointsCoincide(geometryCurve2EndPoint.X, geometryCurve2EndPoint.Z, intersectionPoint.X, - intersectionPoint.Z, 0.001)) + intersectionPoint.Z, GeometryConstants.Tolerance)) { Point2D point = geometryData.CreatePointAndAddItToTheProperListsWhenNeeded(new Point2D(intersectionPoint.X, intersectionPoint.Z)); @@ -1248,7 +1248,7 @@ { if ((index2 != index1) && (Routines2D.DetermineIfPointsCoincide( geometryData.Points[index1].X, geometryData.Points[index1].Z, - geometryData.Points[index2].X, geometryData.Points[index2].Z, 0.001))) + geometryData.Points[index2].X, geometryData.Points[index2].Z, GeometryConstants.Tolerance))) { aConnectedAtHeadCurveList.Clear(); aConnectedAtEndCurveList.Clear();