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

Doors-and-walls-update #74

Merged
merged 57 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
036ea8f
Add overrides for interior partitions
nadiia-volyk Jun 26, 2023
6d0ec2e
Merge branch 'master' into nvolyk/add-overrides-for-interior-partitions
serenayl Jul 12, 2023
c669007
Sort hypar.json
serenayl Jul 12, 2023
c773f3d
Add DoorOpeningType and DoorOpeningSide enums
srudenkoamc Aug 16, 2023
5ecd6a0
Added OpeningSide and OpeningType properties to Door
srudenkoamc Aug 16, 2023
a5e1e5d
Adjust schematic visualization to OpeningSide and OpeningType
srudenkoamc Aug 16, 2023
c159a07
Use StandardWall instead of WallCandidate
srudenkoamc Aug 17, 2023
6190eb6
Distinguish original position and current position during a door plac…
srudenkoamc Aug 17, 2023
09ccb51
Added Opening, small visualization changes
srudenkoamc Aug 18, 2023
0a01560
Use Wall instead of StandardWall
srudenkoamc Aug 21, 2023
c2d26d9
Remove parameter from GetOpeningTransform
srudenkoamc Aug 28, 2023
60834bd
Added spaces between words to face enums values
srudenkoamc Aug 28, 2023
6d1ad30
Updated Elements version
srudenkoamc Oct 25, 2023
81c4ca7
Fixed enum conversion issue
srudenkoamc Oct 25, 2023
5b41911
Merge branch 'master' into update-door-opening-type
srudenkoamc Oct 25, 2023
0ad201f
Fixed an issue
srudenkoamc Oct 25, 2023
50d251f
Change Hypar.Elements and Hypar.Functions to ones that correspond to …
srudenkoamc Oct 26, 2023
62508ab
Merge cleanup.
ikeough Oct 29, 2023
8d5e60f
Add the layout dep to get code completion.
ikeough Oct 29, 2023
32caa82
Splitting works with thickness.
ikeough Oct 29, 2023
474f21d
Update to use RoomEdge in more locations.
ikeough Oct 29, 2023
22ab363
Wall thicknesses are carrying through.
ikeough Oct 29, 2023
80b9958
Set tolerance back to previous.
ikeough Oct 29, 2023
ba4b549
Remove splitting and dedup for the moment.
ikeough Oct 29, 2023
d44ef66
Add model streaming.
ikeough Oct 30, 2023
52f2dbc
Merge branch 'master' into wall-overrides
ikeough Oct 30, 2023
610c366
simplification
anthonie-kramer Oct 30, 2023
438a10c
updating representations WIP
anthonie-kramer Oct 31, 2023
fb53749
primary edge temp
anthonie-kramer Nov 1, 2023
626fd83
Merge branch 'master' into representations-test
anthonie-kramer Nov 1, 2023
95c4ddc
update primary entry edge
anthonie-kramer Nov 1, 2023
02d053c
update
anthonie-kramer Nov 1, 2023
dde6289
update sub
anthonie-kramer Nov 1, 2023
f643a6e
udpate to versions
anthonie-kramer Nov 2, 2023
d1b4436
Merge commit 'e7cdce0440b8cd270d875471b4dd9507080e3988' into HEAD
anthonie-kramer Nov 8, 2023
a3e8d28
doors use roomedge
anthonie-kramer Nov 8, 2023
487bdf2
Merge commit 'f643a6e4165cc54d88c3c41bf8df5ebb370a4a17' into doors-an…
anthonie-kramer Nov 8, 2023
04e4f11
update to doors and interior partitions
anthonie-kramer Nov 9, 2023
dfca510
adding door element updates
anthonie-kramer Nov 15, 2023
5b0f254
space planning sub
anthonie-kramer Nov 15, 2023
f6edb57
minor update
anthonie-kramer Nov 17, 2023
52ee5f6
final pass for doors update
anthonie-kramer Nov 20, 2023
107e73f
removing old stuff
anthonie-kramer Nov 20, 2023
a9191fb
check and space planning update
anthonie-kramer Nov 20, 2023
fc734a5
don't need level transform, line is at correct position
anthonie-kramer Nov 21, 2023
83384cf
simpler enum conversion
anthonie-kramer Nov 21, 2023
80355de
renaming for clarity
anthonie-kramer Nov 21, 2023
d392ddf
mullion and door height update
anthonie-kramer Nov 21, 2023
41e2ac7
more clarity
anthonie-kramer Nov 21, 2023
0b914f3
oopsie
anthonie-kramer Nov 21, 2023
fb9810b
nits
anthonie-kramer Nov 22, 2023
c6afb0c
wall corner fix and dependency update
anthonie-kramer Nov 30, 2023
ba5d8e2
everything working
anthonie-kramer Dec 1, 2023
944b87e
latest elements
anthonie-kramer Dec 1, 2023
581a0d2
updates to dependencies so it will build
anthonie-kramer Dec 2, 2023
3c67419
update to latest
anthonie-kramer Dec 2, 2023
8cec412
oopsie doopsie
anthonie-kramer Dec 2, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Hypar.Elements" Version="2.1.0" />
<PackageReference Include="Hypar.Functions" Version="1.10.0" />
<!-- <PackageReference Include="Hypar.Space.LayoutFunctionCommon" Version="1.4.0" /> -->
</ItemGroup>
<ItemGroup>
<!-- <ProjectReference Include="..\..\..\Elements\Elements\src\Elements.csproj" /> -->
<ProjectReference Include="..\..\LayoutFunctionCommon\LayoutFunctionCommon.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Hypar.Elements" Version="2.2.0-alpha.17" />
<PackageReference Include="Hypar.Functions" Version="1.11.0-alpha.10" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public LevelVolume()
public System.Guid? PlanView { get; set; }

/// <summary>Multiple profiles used for a collection of volumes</summary>
[JsonProperty("Profiles", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("Profiles", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public IList<Profile> Profiles { get; set; }


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Hypar.Elements" Version="2.1.0" />
<PackageReference Include="Hypar.Elements.Components" Version="2.1.0" />
<PackageReference Include="Hypar.Functions" Version="1.10.0" />
<PackageReference Include="Hypar.Elements" Version="2.2.0-alpha.17" />
<PackageReference Include="Hypar.Functions" Version="1.11.0-alpha.10" />
<PackageReference Include="Hypar.Elements.Components" Version="2.2.0-alpha.17" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion LayoutFunctions/CustomLayout/dependencies/LevelVolume.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public LevelVolume()
public System.Guid? PlanView { get; set; }

/// <summary>Multiple profiles used for a collection of volumes</summary>
[JsonProperty("Profiles", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("Profiles", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public IList<Profile> Profiles { get; set; }


Expand Down
25 changes: 12 additions & 13 deletions LayoutFunctions/CustomLayout/src/CustomSpaceType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static CustomSpaceTypeOutputs Execute(Dictionary<string, Model> inputMode
var anchorIndex = Enumerable.Range(0, anchors.Count).OrderBy(a => anchors[a].DistanceTo(anchor)).First();
var closestAnchor = anchors[anchorIndex];
var offsetXform = placedInstance.Transform.Concatenated(new Transform(anchor.Negate())).Concatenated(new Transform(anchor - closestAnchor));
// create rule
// create rule
var placementRule = new PositionPlacementRule(placedInstance.Name, anchorIndex, placedInstance.BaseDefinition, offsetXform);
rules.Add(placementRule);

Expand Down Expand Up @@ -132,19 +132,14 @@ public static CustomSpaceTypeOutputs Execute(Dictionary<string, Model> inputMode
public static Polygon[] OffsetThickenedPolyline(ThickenedPolyline wall, Polyline p)
{
Polygon[] offsets = null;
if (wall.Width.HasValue && wall.Flip.HasValue)

if (wall.LeftWidth > Vector3.EPSILON)
{
offsets = p.OffsetOnSide(wall.Width.Value, wall.Flip.Value);
p = p.OffsetOpen(-wall.LeftWidth);
}
else
{
if (wall.LeftWidth > Vector3.EPSILON)
{
p = p.OffsetOpen(-wall.LeftWidth);
}

offsets = p.OffsetOnSide(wall.LeftWidth + wall.RightWidth, false);
}
offsets = p.OffsetOnSide(wall.LeftWidth + wall.RightWidth, false);

return offsets;
}

Expand All @@ -161,9 +156,13 @@ private static void LayOutAllRoomsOfSpaceType(Model model, IEnumerable<LevelVolu
foreach (var room in meetingRmBoundaries)
{
var spaceBoundary = room.Boundary;
Line orientationGuideEdge = WallGeneration.FindPrimaryAccessEdge(spaceBoundary.Perimeter.Segments(), corridorSegments, levelVolume?.Profile, out var otherSegments);

var orientationTransform = new Transform(Vector3.Origin, orientationGuideEdge.Direction(), Vector3.ZAxis);
var roomEdges = new List<RoomEdge>();
roomEdges.AddRange(spaceBoundary.Perimeter.Segments().Select(s => new RoomEdge() { Line = s }));

RoomEdge orientationGuideEdge = WallGeneration.FindPrimaryAccessEdge(roomEdges, corridorSegments, levelVolume?.Profile, out var otherSegments);

var orientationTransform = new Transform(Vector3.Origin, orientationGuideEdge.Line.Direction(), Vector3.ZAxis);
var boundaryCurves = new List<Polygon>();
boundaryCurves.Add(spaceBoundary.Perimeter);
boundaryCurves.AddRange(spaceBoundary.Voids ?? new List<Polygon>());
Expand Down
10 changes: 5 additions & 5 deletions LayoutFunctions/CustomLayout/test/WallOffsetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void WallOffsetTest()
new Vector3(10,10,0)
});

var tp = new ThickenedPolyline(polyline, 1.0, false, 0.0, 0.0);
var tp = new ThickenedPolyline(polyline, 0, 0);
var walls = CustomSpaceType.OffsetThickenedPolyline(tp, polyline);
Assert.Equal(2, walls.Count());
Assert.Equal(4, walls.First().Vertices.Count);
Expand All @@ -36,7 +36,7 @@ public void WallOffsetTest()
Assert.Contains(new Vector3(11, 10, 0), walls.Last().Vertices);
Assert.Contains(new Vector3(10, 10, 0), walls.Last().Vertices);

tp = new ThickenedPolyline(polyline, 1.0, true, 0.0, 0.0);
tp = new ThickenedPolyline(polyline, 0, 0);
walls = CustomSpaceType.OffsetThickenedPolyline(tp, polyline);
Assert.Contains(new Vector3(0, 1, 0), walls.First().Vertices);
Assert.Contains(new Vector3(9, 1, 0), walls.First().Vertices);
Expand All @@ -47,7 +47,7 @@ public void WallOffsetTest()
Assert.Contains(new Vector3(9, 10, 0), walls.Last().Vertices);
Assert.Contains(new Vector3(10, 10, 0), walls.Last().Vertices);

tp = new ThickenedPolyline(polyline, null, null, 0.0, 1.0);
tp = new ThickenedPolyline(polyline, 0, 1);
walls = CustomSpaceType.OffsetThickenedPolyline(tp, polyline);
Assert.Equal(2, walls.Count());
Assert.Equal(4, walls.First().Vertices.Count);
Expand All @@ -61,7 +61,7 @@ public void WallOffsetTest()
Assert.Contains(new Vector3(11, 10, 0), walls.Last().Vertices);
Assert.Contains(new Vector3(10, 10, 0), walls.Last().Vertices);

tp = new ThickenedPolyline(polyline, null, null, 1.0, 0.0);
tp = new ThickenedPolyline(polyline, 1, 0);
walls = CustomSpaceType.OffsetThickenedPolyline(tp, polyline);
Assert.Contains(new Vector3(0, 1, 0), walls.First().Vertices);
Assert.Contains(new Vector3(9, 1, 0), walls.First().Vertices);
Expand All @@ -72,7 +72,7 @@ public void WallOffsetTest()
Assert.Contains(new Vector3(9, 10, 0), walls.Last().Vertices);
Assert.Contains(new Vector3(10, 10, 0), walls.Last().Vertices);

tp = new ThickenedPolyline(polyline, null, null, 0.4, 0.6);
tp = new ThickenedPolyline(polyline, 0.4, 0.6);
walls = CustomSpaceType.OffsetThickenedPolyline(tp, polyline);
Assert.Contains(new Vector3(0, -0.6, 0), walls.First().Vertices);
Assert.Contains(new Vector3(10.6, -0.6, 0), walls.First().Vertices);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<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" Version="2.2.0-alpha.17" />
<PackageReference Include="Hypar.Functions" Version="1.11.0-alpha.10" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ namespace DataHallLayout

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public class DataHallLayoutInputs : S3Args
public class DataHallLayoutInputs : ArgsBase

{
[Newtonsoft.Json.JsonConstructor]

public DataHallLayoutInputs(DataHallLayoutInputsCabinetDepth @cabinetDepth, DataHallLayoutInputsCabinetHeight @cabinetHeight, double @kWRack, double @hotAisleWidth, double @coldAisleWidth, double @clearance, bool @flipDirection, bool @swapColdHotPattern, string bucketName, string uploadsBucket, Dictionary<string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey):
base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
public DataHallLayoutInputs(DataHallLayoutInputsCabinetDepth @cabinetDepth, DataHallLayoutInputsCabinetHeight @cabinetHeight, double @kWRack, double @hotAisleWidth, double @coldAisleWidth, double @clearance, bool @flipDirection, bool @swapColdHotPattern, Dictionary<string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey):
base(modelInputKeys, gltfKey, elementsKey, ifcKey)
{
var validator = Validator.Instance.GetFirstValidatorForType<DataHallLayoutInputs>();
if(validator != null)
Expand Down
10 changes: 3 additions & 7 deletions LayoutFunctions/DataHall/dependencies/DataHallLayoutOutputs.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,28 @@ public class DataHallLayoutOutputs: SystemResults
/// The number of server cabinets.
/// </summary>
[JsonProperty("Rack Count")]
public double RackCount {get; set;}
public double RackCount { get; set; }

/// <summary>
/// Watts per square foot
/// </summary>
[JsonProperty("Watts/sf")]
public string Wattssf {get; set;}


public string Wattssf { get; set; }

/// <summary>
/// Construct a DataHallLayoutOutputs with default inputs.
/// This should be used for testing only.
/// </summary>
public DataHallLayoutOutputs() : base()
{

}


/// <summary>
/// Construct a DataHallLayoutOutputs specifying all inputs.
/// </summary>
/// <returns></returns>
[JsonConstructor]
public DataHallLayoutOutputs(double rackCount, string wattssf): base()
public DataHallLayoutOutputs(double rackCount, string wattssf) : base()
{
this.RackCount = rackCount;
this.Wattssf = wattssf;
Expand Down
8 changes: 4 additions & 4 deletions LayoutFunctions/DataHall/server/DataHallLayout.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<ItemGroup>
<ProjectReference Include="..\src\DataHallLayout.csproj" />
<ItemGroup>
<ProjectReference Include="..\src\DataHallLayout.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Hypar.Server" Version="1.8.0" />
<ItemGroup>
<PackageReference Include="Hypar.Server" Version="1.11.0-alpha.10" />
</ItemGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion LayoutFunctions/DataHall/server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ await HyparServer.StartAsync(
var input = executionRequest.Args.ToObject<DataHallLayout.DataHallLayoutInputs>();
var function = new DataHallLayout.Function();
Directory.SetCurrentDirectory(Path.GetDirectoryName(typeof(DataHallLayout.Function).Assembly.Location)!);
return await function.Handler(input, null);
return await function.Handler(input);
});
}
}
Expand Down
16 changes: 4 additions & 12 deletions LayoutFunctions/DataHall/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Edits to this code will be overwritten the next time you run 'hypar init'.
// DO NOT EDIT THIS FILE.

using Amazon;
using Amazon.Lambda.Core;
using Hypar.Functions.Execution;
using Hypar.Functions.Execution.AWS;
Expand All @@ -19,9 +18,9 @@ public class Function
{
// Cache the model store for use by subsequent
// executions of this lambda.
private IModelStore<DataHallLayoutInputs> store;
private UrlModelStore<DataHallLayoutInputs> store;

public async Task<DataHallLayoutOutputs> Handler(DataHallLayoutInputs args, ILambdaContext context)
public async Task<DataHallLayoutOutputs> Handler(DataHallLayoutInputs args)
{
// Preload dependencies (if they exist),
// so that they are available during model deserialization.
Expand Down Expand Up @@ -61,15 +60,8 @@ public async Task<DataHallLayoutOutputs> Handler(DataHallLayoutInputs args, ILam
Console.WriteLine($"Time to load assemblies: {sw.Elapsed.TotalSeconds})");

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


Expand Down
29 changes: 29 additions & 0 deletions LayoutFunctions/Doors/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "0.2.0",
"inputs": [
{
"id": "workflowId",
"type": "promptString",
"description": "Enter the workflow id to run."
}
],
"configurations": [
{
"name": "Attach to Hypar Run",
"type": "coreclr",
"request": "attach",
"processName": "Doors.Server"
},
{
"name": "Launch Hypar Run (Run once only)",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/server/bin/Debug/net6.0/Doors.Server.dll",
"args": [
"--workflow-id",
"${input:workflowId}"
],
"preLaunchTask": "server-build"
}
]
}
15 changes: 15 additions & 0 deletions LayoutFunctions/Doors/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "server-build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/server/Doors.Server.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
3 changes: 2 additions & 1 deletion LayoutFunctions/Doors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Create doors for space boundary rooms.
|---|---|---|
|Default Door Width|number|Width of a door panel without a frame. For double doors, the clear width will be double the door width.|
|Default Door Height|number|Height of a door without a frame.|
|Default Type|string|The type of door.|
|Default Door Opening Side|string|The opening side of a door.|
|Default Door Opening Type|string|The type of a door.|


<br>
Expand Down
1 change: 1 addition & 0 deletions LayoutFunctions/Doors/dependencies/CirculationSegment.g.cs
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
Loading
Loading