Skip to content

Commit

Permalink
Merge pull request #92 from DmytroMuravskyi/dmuravskyi/interior-parti…
Browse files Browse the repository at this point in the history
…tions-fix

Use ""Partition" line as dominant is case if all lines are "Partition" to prevent exception (#92)
  • Loading branch information
anthonie-kramer authored Jan 19, 2024
2 parents 9a50043 + 0b43a5c commit 7e90536
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 7e90536

Please sign in to comment.