Skip to content

Commit

Permalink
Use ""Partition" line as dominant is case if all lines are "Partition…
Browse files Browse the repository at this point in the history
…" to prevent exception
  • Loading branch information
DmytroMuravskyi committed Jan 17, 2024
1 parent 9a50043 commit 0b43a5c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion LayoutFunctions/LayoutFunctionCommon/WallGeneration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,13 @@ public static List<RoomEdge> SplitOverlappingWallCandidates(IEnumerable<RoomEdge
resultCandidates.Add(candidate);
continue;
}
var linesOrderedByLength = collinearLinesGroup.Value.Where(x => !x.Item2.Contains("Partition")).OrderByDescending(v => v.Line.Length());
var filteredLines = collinearLinesGroup.Value.Where(x => !x.Item2.Contains("Partition"));
if (!filteredLines.Any())
{
filteredLines = collinearLinesGroup.Value;
}

var linesOrderedByLength = filteredLines.OrderByDescending(v => v.Line.Length());

var dominantLineForGroup = linesOrderedByLength.FirstOrDefault(x => x.PrimaryEntryEdge == true);

Expand Down

0 comments on commit 0b43a5c

Please sign in to comment.