Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't add a wall candidate element if there are no candidates #98

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LayoutFunctions/ClassroomLayout/src/ClassroomLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public static ClassroomLayoutOutputs Execute(Dictionary<string, Model> inputMode
output.Model.AddElement(new SpaceMetric(room.Id, seatsCount, 0, 0, 0));
}
var height = meetingRmBoundaries.FirstOrDefault()?.Height ?? 3;
if (input.CreateWalls)
if (input.CreateWalls && wallCandidateLines.Any())
{
output.Model.AddElement(new InteriorPartitionCandidate(Guid.NewGuid())
{
Expand Down
2 changes: 1 addition & 1 deletion LayoutFunctions/LayoutFunctionCommon/LayoutGeneration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public virtual LayoutGenerationResult StandardLayoutOnAllLevels(string programTy
double height = levelVolume?.Height ?? 3;
Transform xform = levelVolume?.Transform ?? new Transform();

if (createWalls)
if (createWalls && wallCandidateLines.Count > 0)
{
outputModel.AddElement(new InteriorPartitionCandidate(Guid.NewGuid())
{
Expand Down
13 changes: 8 additions & 5 deletions LayoutFunctions/LayoutFunctionCommon/LayoutStrategies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,15 @@ Model outputModel
double height = room.Height == 0 ? 3 : room.Height;
Transform xform = levelVolume?.Transform ?? new Transform();

outputModel.AddElement(new InteriorPartitionCandidate(Guid.NewGuid())
if (wallCandidateLines.Count > 0)
{
WallCandidateLines = wallCandidateLines,
Height = height,
LevelTransform = xform,
});
outputModel.AddElement(new InteriorPartitionCandidate(Guid.NewGuid())
{
WallCandidateLines = wallCandidateLines,
Height = height,
LevelTransform = xform,
});
}
}
}
foreach (var room in allSpaceBoundaries)
Expand Down
2 changes: 1 addition & 1 deletion LayoutFunctions/PhoneBoothLayout/src/PhoneBoothLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static PhoneBoothLayoutOutputs Execute(Dictionary<string, Model> inputMod
output.Model.AddElement(new SpaceMetric(room.Id, seatsCount, 0, 0, 0));
}
var height = meetingRmBoundaries.FirstOrDefault()?.Height ?? 3;
if (input.CreateWalls)
if (input.CreateWalls && wallCandidateLines.Count > 0)
{
output.Model.AddElement(new InteriorPartitionCandidate(Guid.NewGuid())
{
Expand Down
13 changes: 8 additions & 5 deletions LayoutFunctions/PrivateOfficeLayout/src/PrivateOfficeLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,15 @@ public static PrivateOfficeLayoutOutputs Execute(Dictionary<string, Model> input
}

var height = privateOfficeBoundaries.FirstOrDefault()?.Height ?? 3;
output.Model.AddElement(new InteriorPartitionCandidate(Guid.NewGuid())
if (wallCandidateLines.Count > 0)
{
WallCandidateLines = wallCandidateLines,
Height = height,
LevelTransform = levelVolume?.Transform ?? new Transform()
});
output.Model.AddElement(new InteriorPartitionCandidate(Guid.NewGuid())
{
WallCandidateLines = wallCandidateLines,
Height = height,
LevelTransform = levelVolume?.Transform ?? new Transform()
});
}
}
output.PrivateOfficeCount = totalPrivateOfficeCount;
OverrideUtilities.InstancePositionOverrides(input.Overrides, output.Model);
Expand Down
Loading