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

Wall thickness #63

Merged
merged 9 commits into from
Oct 13, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ProjectReference Include="..\..\LayoutFunctionCommon\LayoutFunctionCommon.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Hypar.Elements" Version="2.0.0" />
<PackageReference Include="Hypar.Functions" Version="1.8.0" />
<PackageReference Include="Hypar.Elements" Version="2.1.0-alpha.12" />
<PackageReference Include="Hypar.Functions" Version="1.9.0-alpha.3" />
</ItemGroup>
</Project>

This file was deleted.

8 changes: 4 additions & 4 deletions LayoutFunctions/ClassroomLayout/src/ClassroomLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ public static ClassroomLayoutOutputs Execute(Dictionary<string, Model> inputMode
(lvl.AdditionalProperties.TryGetValue("LevelVolumeId", out var levelVolumeId) &&
levelVolumeId as string == l.Id.ToString())) ??
levelVolumes.FirstOrDefault(l => l.Name == lvl.Name);
var wallCandidateLines = new List<(Line line, string type)>();
var wallCandidateLines = new List<RoomEdge>();
foreach (var room in meetingRmBoundaries)
{
var seatsCount = 0;
var spaceBoundary = room.Boundary;
var levelInvertedTransform = levelVolume?.Transform.Inverted() ?? new Transform();
var roomWallCandidatesLines = WallGeneration.FindWallCandidates(room, levelVolume?.Profile, corridorSegments, out Line orientationGuideEdge)
.Select(c => (c.line.TransformedLine(levelInvertedTransform), c.type));
var roomWallCandidatesLines = WallGeneration.FindWallCandidates(room, levelVolume?.Profile, corridorSegments, out RoomEdge orientationGuideEdge)
.Select(c => new RoomEdge { Line = c.Line.TransformedLine(levelInvertedTransform), Type = c.Type, Thickness = c.Thickness });
wallCandidateLines.AddRange(roomWallCandidatesLines);
var orientationTransform = new Transform(Vector3.Origin, orientationGuideEdge.Direction(), Vector3.ZAxis);
var orientationTransform = new Transform(Vector3.Origin, orientationGuideEdge.Direction, Vector3.ZAxis);
var boundaryCurves = new List<Polygon>();
boundaryCurves.Add(spaceBoundary.Perimeter);
boundaryCurves.AddRange(spaceBoundary.Voids ?? new List<Polygon>());
Expand Down
67 changes: 43 additions & 24 deletions LayoutFunctions/InteriorPartitions/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,45 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/test/bin/Debug/netcoreapp3.1/InteriorPartitions.Tests.dll",
"args": [],
"cwd": "${workspaceFolder}/test",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/test/bin/Debug/netcoreapp3.1/InteriorPartitions.Tests.dll",
"args": [],
"cwd": "${workspaceFolder}/test",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
},
{
"name": "Attach to Hypar Run",
"type": "coreclr",
"request": "attach",
"processName": "InteriorPartitions.Server"
},
{
"name": "Launch Hypar Run (Run once only)",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/server/bin/Debug/net6.0/InteriorPartitions.Server.dll",
"args": [
"--workflow-id",
"${input:workflowId}"
],
"preLaunchTask": "server-build"
}
],
"inputs": [
{
"id": "workflowId",
"type": "promptString",
"description": "Enter the workflow id to run."
}
]
}
88 changes: 49 additions & 39 deletions LayoutFunctions/InteriorPartitions/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,51 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/test/InteriorPartitions.Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/test/InteriorPartitions.Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/test/InteriorPartitions.Tests.csproj"
],
"problemMatcher": "$msCompile"
}
]
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/test/InteriorPartitions.Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/test/InteriorPartitions.Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/test/InteriorPartitions.Tests.csproj"
],
"problemMatcher": "$msCompile"
},
{
"label": "server-build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/server/InteriorPartitions.Server.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ProjectReference Include="..\..\LayoutFunctionCommon\LayoutFunctionCommon.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Hypar.Elements" Version="2.0.0" />
<PackageReference Include="Hypar.Functions" Version="1.6.0" />
<PackageReference Include="Hypar.Elements" Version="2.1.0-alpha.12" />
<PackageReference Include="Hypar.Functions" Version="1.9.0-alpha.3" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public SpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, dou
this.HyparSpaceType = @hyparSpaceType;
}


// Empty constructor
public SpaceBoundary()
: base()
Expand Down
12 changes: 12 additions & 0 deletions LayoutFunctions/InteriorPartitions/dependencies/WallCandidate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Elements;
using System;
using System.Linq;
using System.Collections.Generic;
using Elements.Geometry;
namespace Elements
{
public partial class WallCandidate
{
public (double innerWidth, double outerWidth)? Thickness { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public WallCandidate(Line @line, string @type, IList<SpaceBoundary> @spaceAdjace
this.SpaceAdjacencies = @spaceAdjacencies;
}


// Empty constructor
public WallCandidate()
: base()
Expand Down
5 changes: 5 additions & 0 deletions LayoutFunctions/InteriorPartitions/hypar.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
"autohide": false,
"name": "Room Layout",
"optional": true
},
{
"autohide": false,
"name": "Furniture and Equipment",
"optional": true
}
],
"outputs": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

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

<ItemGroup>
<PackageReference Include="Hypar.Server" Version="1.9.0-alpha.3" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
26 changes: 26 additions & 0 deletions LayoutFunctions/InteriorPartitions/server/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

using System;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using System.Linq;

namespace Hypar.Server
{
public class Program
{
public static async Task Main(string[] args)
{
await HyparServer.StartAsync(
args,
Path.GetFullPath(Path.Combine(Assembly.GetExecutingAssembly().Location, "../../../../..")),
async (executionRequest) =>
{
var input = executionRequest.Args.ToObject<InteriorPartitions.InteriorPartitionsInputs>();
var function = new InteriorPartitions.Function();
Directory.SetCurrentDirectory(Path.GetDirectoryName(typeof(InteriorPartitions.Function).Assembly.Location)!);
return await function.Handler(input, null);
});
}
}
}
9 changes: 8 additions & 1 deletion LayoutFunctions/InteriorPartitions/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ public async Task<InteriorPartitionsOutputs> Handler(InteriorPartitionsInputs ar

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

var l = new InvocationWrapper<InteriorPartitionsInputs,InteriorPartitionsOutputs> (store, InteriorPartitions.Execute);
Expand Down
Loading
Loading