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

Update walls to use space height #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
Binary file not shown.
Empty file.
Binary file added .vs/HyparSpace/v17/.wsuo
Binary file not shown.
Binary file added .vs/HyparSpace/v17/workspaceFileList.bin
Binary file not shown.
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": null
}
6 changes: 6 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
1 change: 0 additions & 1 deletion LayoutFunctions/ClassroomLayout/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public async Task<ClassroomLayoutOutputs> Handler(ClassroomLayoutInputs args, IL
this.store = new UrlModelStore<ClassroomLayoutInputs>();
}
}


var l = new InvocationWrapper<ClassroomLayoutInputs,ClassroomLayoutOutputs> (store, ClassroomLayout.Execute);
var output = await l.InvokeAsync(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public CirculationSegment(ThickenedPolyline @geometry, Profile @profile, double
this.Geometry = @geometry;
}


// Empty constructor
public CirculationSegment()
: base()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="Hypar.Elements" Version="2.1.0-alpha.22" />
<PackageReference Include="Hypar.Functions" Version="1.9.0-alpha.3" />
<PackageReference Include="Hypar.Elements.Components" Version="2.0.0" />
<PackageReference Include="Hypar.Elements.Components" Version="2.1.0-alpha.22" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public LevelElements(IList<Element> @elements, System.Guid @level, System.Guid @
this.Level = @level;
}


// Empty constructor
public LevelElements()
: base()
Expand Down
1 change: 1 addition & 0 deletions LayoutFunctions/CustomLayout/dependencies/LevelVolume.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public LevelVolume(Profile @profile, double @height, double @area, string @build
this.PlanView = @planView;
}


// Empty constructor
public LevelVolume()
: base()
Expand Down
9 changes: 7 additions & 2 deletions LayoutFunctions/CustomLayout/dependencies/SpaceBoundary.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Elements
public partial class SpaceBoundary : GeometricElement
{
[JsonConstructor]
public SpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, double? @length, double? @depth, double @height, string @programGroup, string @programType, System.Guid? @level, System.Guid? @levelLayout, string @hyparSpaceType, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
public SpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, double? @length, double? @depth, double @height, string @programGroup, string @programType, System.Guid? @programRequirement, System.Guid? @level, System.Guid? @levelLayout, string @hyparSpaceType, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
: base(transform, material, representation, isElementDefinition, id, name)
{
this.Boundary = @boundary;
Expand All @@ -38,11 +38,13 @@ public SpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, dou
this.Height = @height;
this.ProgramGroup = @programGroup;
this.ProgramType = @programType;
this.ProgramRequirement = @programRequirement;
this.Level = @level;
this.LevelLayout = @levelLayout;
this.HyparSpaceType = @hyparSpaceType;
}


// Empty constructor
public SpaceBoundary()
: base()
Expand Down Expand Up @@ -78,9 +80,12 @@ public SpaceBoundary()
public string ProgramGroup { get; set; }

/// <summary>The name of the program type assigned to this space (like "Open Office" or "Meeting Room")</summary>
[JsonProperty("Program Type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("Program Type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string ProgramType { get; set; }

[JsonProperty("Program Requirement", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid? ProgramRequirement { get; set; }

[JsonProperty("Level", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid? Level { get; set; }

Expand Down
63 changes: 0 additions & 63 deletions LayoutFunctions/CustomLayout/dependencies/ThickenedPolyline.g.cs

This file was deleted.

9 changes: 8 additions & 1 deletion LayoutFunctions/CustomLayout/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ public async Task<CustomSpaceTypeOutputs> Handler(CustomSpaceTypeInputs args, IL

if(this.store == null)
{
this.store = new S3ModelStore<CustomSpaceTypeInputs>(RegionEndpoint.GetBySystemName("us-west-1"));
if (args.SignedResourceUrls == null)
{
this.store = new S3ModelStore<CustomSpaceTypeInputs>(RegionEndpoint.GetBySystemName("us-west-1"));
}
else
{
this.store = new UrlModelStore<CustomSpaceTypeInputs>();
}
}

var l = new InvocationWrapper<CustomSpaceTypeInputs,CustomSpaceTypeOutputs> (store, CustomSpaceType.Execute);
Expand Down
1 change: 0 additions & 1 deletion LayoutFunctions/DataHall/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public async Task<DataHallLayoutOutputs> Handler(DataHallLayoutInputs args, ILam
this.store = new UrlModelStore<DataHallLayoutInputs>();
}
}


var l = new InvocationWrapper<DataHallLayoutInputs,DataHallLayoutOutputs> (store, DataHallLayout.Execute);
var output = await l.InvokeAsync(args);
Expand Down
1 change: 0 additions & 1 deletion LayoutFunctions/InteriorPartitions/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public async Task<InteriorPartitionsOutputs> Handler(InteriorPartitionsInputs ar
this.store = new UrlModelStore<InteriorPartitionsInputs>();
}
}


var l = new InvocationWrapper<InteriorPartitionsInputs,InteriorPartitionsOutputs> (store, InteriorPartitions.Execute);
var output = await l.InvokeAsync(args);
Expand Down
3 changes: 2 additions & 1 deletion LayoutFunctions/LayoutFunctionCommon/ISpaceBoundary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

namespace Elements
{
public interface ISpaceBoundary
public interface ISpaceBoundary
{
string Name { get; set; }
double Height { get; set; }
Profile Boundary { get; set; }
Transform Transform { get; set; }

Expand Down
25 changes: 25 additions & 0 deletions LayoutFunctions/LayoutFunctionCommon/LayoutFunctionCommon.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LayoutFunctionCommon", "LayoutFunctionCommon.csproj", "{C53DF230-3697-4473-A5BD-9DDDC33034AC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C53DF230-3697-4473-A5BD-9DDDC33034AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C53DF230-3697-4473-A5BD-9DDDC33034AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C53DF230-3697-4473-A5BD-9DDDC33034AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C53DF230-3697-4473-A5BD-9DDDC33034AC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BF0B1456-9B6F-402E-8AA1-91B65709B119}
EndGlobalSection
EndGlobal
45 changes: 24 additions & 21 deletions LayoutFunctions/LayoutFunctionCommon/LayoutStrategies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static LayoutInstantiated InstantiateLayoutByFit(SpaceConfiguration confi
}
var baseRectangle = Polygon.Rectangle(layoutInstantiated.Config.CellBoundary.Min, layoutInstantiated.Config.CellBoundary.Max);

// This null url check is needed because a few configs got generated with instances that weren't contentelements.
// This null url check is needed because a few configs got generated with instances that weren't contentelements.
// We've fixed this API-side, but there might be a few configs circa 2023-09 that need this.
foreach (var contentItem in layoutInstantiated.Config.ContentItems.ToArray())
{
Expand Down Expand Up @@ -200,20 +200,21 @@ public static HashSet<Guid> StandardLayoutOnAllLevels<TLevelElements, TLevelVolu
{
processedSpaces.Add(room.Id);
ProcessRoom(room, outputModel, countSeats, configs, corridorSegments, levelVolume, wallCandidateLines);
}

double height = levelVolume?.Height ?? 3;
Transform xform = levelVolume?.Transform ?? new Transform();
double height = room.Height == 0 ? 3 : room.Height;
Transform xform = levelVolume?.Transform ?? new Transform();

if (createWalls)
{
outputModel.AddElement(new InteriorPartitionCandidate(Guid.NewGuid())
if (createWalls)
{
WallCandidateLines = wallCandidateLines,
Height = height,
LevelTransform = xform,
});
outputModel.AddElement(new InteriorPartitionCandidate(Guid.NewGuid())
{
WallCandidateLines = wallCandidateLines,
Height = height,
LevelTransform = xform,
});
}
}

}
foreach (var room in allSpaceBoundaries)
{
Expand All @@ -227,7 +228,7 @@ public static HashSet<Guid> StandardLayoutOnAllLevels<TLevelElements, TLevelVolu

/// <summary>
/// Basically the same as StandardLayoutOnAllLevels, but without the actual furniture layout part — just the wall creation.
/// </summary>
/// </summary>
public static void GenerateWallsForAllSpaces<TLevelElements, TLevelVolume, TSpaceBoundary, TCirculationSegment>(
IEnumerable<TSpaceBoundary> spaceBoundaries,
Dictionary<string, Model> inputModels,
Expand Down Expand Up @@ -264,18 +265,20 @@ Model outputModel
foreach (var room in roomBoundaries)
{
GenerateWallsForSpace(room, levelVolume, corridorSegments, wallCandidateLines);
}

double height = levelVolume?.Height ?? 3;
Transform xform = levelVolume?.Transform ?? new Transform();
double height = room.Height == 0 ? 3 : room.Height;
Transform xform = levelVolume?.Transform ?? new Transform();

outputModel.AddElement(new InteriorPartitionCandidate(Guid.NewGuid())
{
WallCandidateLines = wallCandidateLines,
Height = height,
LevelTransform = xform,
});
}

outputModel.AddElement(new InteriorPartitionCandidate(Guid.NewGuid())
{
WallCandidateLines = wallCandidateLines,
Height = height,
LevelTransform = xform,
});
}

foreach (var room in allSpaceBoundaries)
{
GenerateWallsForSpace<TLevelVolume, TSpaceBoundary>(room, null, null, null);
Expand Down
1 change: 0 additions & 1 deletion LayoutFunctions/LoungeLayout/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public async Task<LoungeLayoutOutputs> Handler(LoungeLayoutInputs args, ILambdaC
this.store = new UrlModelStore<LoungeLayoutInputs>();
}
}


var l = new InvocationWrapper<LoungeLayoutInputs,LoungeLayoutOutputs> (store, LoungeLayout.Execute);
var output = await l.InvokeAsync(args);
Expand Down
1 change: 0 additions & 1 deletion LayoutFunctions/MeetingRoomLayout/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public async Task<MeetingRoomLayoutOutputs> Handler(MeetingRoomLayoutInputs args
this.store = new UrlModelStore<MeetingRoomLayoutInputs>();
}
}


var l = new InvocationWrapper<MeetingRoomLayoutInputs,MeetingRoomLayoutOutputs> (store, MeetingRoomLayout.Execute);
var output = await l.InvokeAsync(args);
Expand Down
1 change: 0 additions & 1 deletion LayoutFunctions/OpenCollabLayout/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public async Task<OpenCollaborationLayoutOutputs> Handler(OpenCollaborationLayou
this.store = new UrlModelStore<OpenCollaborationLayoutInputs>();
}
}


var l = new InvocationWrapper<OpenCollaborationLayoutInputs,OpenCollaborationLayoutOutputs> (store, OpenCollaborationLayout.Execute);
var output = await l.InvokeAsync(args);
Expand Down
1 change: 0 additions & 1 deletion LayoutFunctions/OpenOfficeLayout/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public async Task<OpenOfficeLayoutOutputs> Handler(OpenOfficeLayoutInputs args,
this.store = new UrlModelStore<OpenOfficeLayoutInputs>();
}
}


var l = new InvocationWrapper<OpenOfficeLayoutInputs,OpenOfficeLayoutOutputs> (store, OpenOfficeLayout.Execute);
var output = await l.InvokeAsync(args);
Expand Down
1 change: 0 additions & 1 deletion LayoutFunctions/PantryLayout/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public async Task<PantryLayoutOutputs> Handler(PantryLayoutInputs args, ILambdaC
this.store = new UrlModelStore<PantryLayoutInputs>();
}
}


var l = new InvocationWrapper<PantryLayoutInputs,PantryLayoutOutputs> (store, PantryLayout.Execute);
var output = await l.InvokeAsync(args);
Expand Down
1 change: 0 additions & 1 deletion LayoutFunctions/PhoneBoothLayout/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public async Task<PhoneBoothLayoutOutputs> Handler(PhoneBoothLayoutInputs args,
this.store = new UrlModelStore<PhoneBoothLayoutInputs>();
}
}


var l = new InvocationWrapper<PhoneBoothLayoutInputs,PhoneBoothLayoutOutputs> (store, PhoneBoothLayout.Execute);
var output = await l.InvokeAsync(args);
Expand Down
1 change: 0 additions & 1 deletion LayoutFunctions/PrivateOfficeLayout/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public async Task<PrivateOfficeLayoutOutputs> Handler(PrivateOfficeLayoutInputs
this.store = new UrlModelStore<PrivateOfficeLayoutInputs>();
}
}


var l = new InvocationWrapper<PrivateOfficeLayoutInputs,PrivateOfficeLayoutOutputs> (store, PrivateOfficeLayout.Execute);
var output = await l.InvokeAsync(args);
Expand Down
1 change: 0 additions & 1 deletion LayoutFunctions/ReceptionLayout/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public async Task<ReceptionLayoutOutputs> Handler(ReceptionLayoutInputs args, IL
this.store = new UrlModelStore<ReceptionLayoutInputs>();
}
}


var l = new InvocationWrapper<ReceptionLayoutInputs,ReceptionLayoutOutputs> (store, ReceptionLayout.Execute);
var output = await l.InvokeAsync(args);
Expand Down