diff --git a/LayoutFunctions/WallsLOD200/dependencies/WallsLOD200.Dependencies.csproj b/LayoutFunctions/WallsLOD200/dependencies/WallsLOD200.Dependencies.csproj
index a58e7b7a..e8277aec 100644
--- a/LayoutFunctions/WallsLOD200/dependencies/WallsLOD200.Dependencies.csproj
+++ b/LayoutFunctions/WallsLOD200/dependencies/WallsLOD200.Dependencies.csproj
@@ -6,9 +6,9 @@
enable
-
-
-
+
+
+
diff --git a/LayoutFunctions/WallsLOD200/src/WallsLOD200.cs b/LayoutFunctions/WallsLOD200/src/WallsLOD200.cs
index 506c444d..c124252c 100644
--- a/LayoutFunctions/WallsLOD200/src/WallsLOD200.cs
+++ b/LayoutFunctions/WallsLOD200/src/WallsLOD200.cs
@@ -5,6 +5,7 @@ namespace WallsLOD200
{
public static partial class WallsLOD200
{
+ public static double tolerance = 0.0001;
///
/// The WallsLOD200 function.
///
@@ -114,8 +115,13 @@ private static List MergeCollinearLines(List lines)
{
Line otherLine = mergedLines[j];
- if (line.TryGetOverlap(otherLine, out var overlap) || line.DistanceTo(otherLine) < 0.0001)
+ if (line.TryGetOverlap(otherLine, out var overlap) || line.DistanceTo(otherLine) < tolerance)
{
+ // project lines within tolerance but further than epsilon
+ if (line.DistanceTo(otherLine) > double.Epsilon)
+ {
+ otherLine = otherLine.Projected(line);
+ }
// Merge collinear lines
Line mergedLine = line.MergedCollinearLine(otherLine);