diff --git a/Structure/StructureByEnvelope/dependencies/Camera.g.cs b/Structure/StructureByEnvelope/dependencies/Camera.g.cs index f9aa964c..f8f7fb70 100644 --- a/Structure/StructureByEnvelope/dependencies/Camera.g.cs +++ b/Structure/StructureByEnvelope/dependencies/Camera.g.cs @@ -34,6 +34,7 @@ public Camera(Vector3 @angle, CameraNamedPosition? @namedPosition, CameraProject this.Projection = @projection; } + // Empty constructor public Camera() { diff --git a/Structure/StructureByEnvelope/dependencies/Grid2dElement.g.cs b/Structure/StructureByEnvelope/dependencies/Grid2dElement.g.cs index d685506f..6b4a4388 100644 --- a/Structure/StructureByEnvelope/dependencies/Grid2dElement.g.cs +++ b/Structure/StructureByEnvelope/dependencies/Grid2dElement.g.cs @@ -36,6 +36,7 @@ public Grid2dElement(Grid2d @grid, IList @gridNodes, IList @uG this.VGridLines = @vGridLines; } + // Empty constructor public Grid2dElement() : base() diff --git a/Structure/StructureByEnvelope/dependencies/GridNode.g.cs b/Structure/StructureByEnvelope/dependencies/GridNode.g.cs index bdfa247c..56b7b85b 100644 --- a/Structure/StructureByEnvelope/dependencies/GridNode.g.cs +++ b/Structure/StructureByEnvelope/dependencies/GridNode.g.cs @@ -35,6 +35,7 @@ public GridNode(Transform @location, string @uGridline, string @vGridline, Syste this.VGridline = @vGridline; } + // Empty constructor public GridNode() : base() diff --git a/Structure/StructureByEnvelope/dependencies/LabelConfiguration.g.cs b/Structure/StructureByEnvelope/dependencies/LabelConfiguration.g.cs index f16b6d22..417ac3e6 100644 --- a/Structure/StructureByEnvelope/dependencies/LabelConfiguration.g.cs +++ b/Structure/StructureByEnvelope/dependencies/LabelConfiguration.g.cs @@ -27,7 +27,7 @@ namespace Elements public partial class LabelConfiguration { [JsonConstructor] - public LabelConfiguration(Color @color, Vector3 @offset, string @customText, string @forceVisible, Vector3 @direction) + public LabelConfiguration(Color? @color, Vector3 @offset, string @customText, string @forceVisible, Vector3 @direction) { this.Color = @color; this.Offset = @offset; @@ -36,6 +36,7 @@ public LabelConfiguration(Color @color, Vector3 @offset, string @customText, str this.Direction = @direction; } + // Empty constructor public LabelConfiguration() { @@ -43,7 +44,7 @@ public LabelConfiguration() /// The label background color [JsonProperty("Color", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Color Color { get; set; } + public Color? Color { get; set; } /// A screen-space offset, in pixels, for the label from the object's bounding box center. [JsonProperty("Offset", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] diff --git a/Structure/StructureByEnvelope/dependencies/LevelPerimeter.g.cs b/Structure/StructureByEnvelope/dependencies/LevelPerimeter.g.cs index fefc9c9b..42a70abb 100644 --- a/Structure/StructureByEnvelope/dependencies/LevelPerimeter.g.cs +++ b/Structure/StructureByEnvelope/dependencies/LevelPerimeter.g.cs @@ -35,6 +35,7 @@ public LevelPerimeter(double @area, double @elevation, Polygon @perimeter, Syste this.Perimeter = @perimeter; } + // Empty constructor public LevelPerimeter() : base() diff --git a/Structure/StructureByEnvelope/dependencies/LevelVolume.g.cs b/Structure/StructureByEnvelope/dependencies/LevelVolume.g.cs index d3164fe8..d437122c 100644 --- a/Structure/StructureByEnvelope/dependencies/LevelVolume.g.cs +++ b/Structure/StructureByEnvelope/dependencies/LevelVolume.g.cs @@ -27,7 +27,7 @@ namespace Elements public partial class LevelVolume : GeometricElement { [JsonConstructor] - public LevelVolume(Profile @profile, double @height, double @area, string @buildingName, System.Guid? @level, System.Guid? @mass, System.Guid? @planView, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null) + public LevelVolume(Profile @profile, double @height, double @area, string @buildingName, System.Guid? @level, System.Guid? @mass, System.Guid? @planView, IList @profiles, 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.Profile = @profile; @@ -37,8 +37,10 @@ public LevelVolume(Profile @profile, double @height, double @area, string @build this.Level = @level; this.Mass = @mass; this.PlanView = @planView; + this.Profiles = @profiles; } + // Empty constructor public LevelVolume() : base() @@ -73,6 +75,10 @@ public LevelVolume() [JsonProperty("Plan View", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public System.Guid? PlanView { get; set; } + /// Multiple profiles used for a collection of volumes + [JsonProperty("Profiles", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public IList Profiles { get; set; } + } } \ No newline at end of file diff --git a/Structure/StructureByEnvelope/dependencies/Structure.Dependencies.csproj b/Structure/StructureByEnvelope/dependencies/Structure.Dependencies.csproj index fe5de428..b7917470 100644 --- a/Structure/StructureByEnvelope/dependencies/Structure.Dependencies.csproj +++ b/Structure/StructureByEnvelope/dependencies/Structure.Dependencies.csproj @@ -5,8 +5,8 @@ - - + + diff --git a/Structure/StructureByEnvelope/dependencies/StructureInputs.g.cs b/Structure/StructureByEnvelope/dependencies/StructureInputs.g.cs index ce64bc4c..bea7e3ae 100644 --- a/Structure/StructureByEnvelope/dependencies/StructureInputs.g.cs +++ b/Structure/StructureByEnvelope/dependencies/StructureInputs.g.cs @@ -24,13 +24,13 @@ namespace Structure [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")] - public class StructureInputs : S3Args + public class StructureInputs : ArgsBase { [Newtonsoft.Json.JsonConstructor] - public StructureInputs(double @gridXAxisInterval, double @gridYAxisInterval, double @slabEdgeOffset, bool @displayGrid, StructureInputsTypeOfConstruction @typeOfConstruction, StructureInputsColumnType @columnType, StructureInputsGirderType @girderType, StructureInputsBeamType @beamType, double @beamSpacing, bool @createBeamsOnFirstLevel, double @slabThickness, bool @insertColumnsAtExternalEdges, double @maximumNeighborSpan, string bucketName, string uploadsBucket, Dictionary modelInputKeys, string gltfKey, string elementsKey, string ifcKey): - base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey) + public StructureInputs(double @gridXAxisInterval, double @gridYAxisInterval, double @slabEdgeOffset, bool @displayGrid, StructureInputsTypeOfConstruction @typeOfConstruction, StructureInputsColumnType @columnType, StructureInputsGirderType @girderType, StructureInputsBeamType @beamType, double @beamSpacing, bool @createBeamsOnFirstLevel, double @slabThickness, bool @insertColumnsAtExternalEdges, double @maximumNeighborSpan, Dictionary modelInputKeys, string gltfKey, string elementsKey, string ifcKey): + base(modelInputKeys, gltfKey, elementsKey, ifcKey) { var validator = Validator.Instance.GetFirstValidatorForType(); if(validator != null) diff --git a/Structure/StructureByEnvelope/dependencies/StructureOutputs.g.cs b/Structure/StructureByEnvelope/dependencies/StructureOutputs.g.cs index 8f0ac873..97e7c936 100644 --- a/Structure/StructureByEnvelope/dependencies/StructureOutputs.g.cs +++ b/Structure/StructureByEnvelope/dependencies/StructureOutputs.g.cs @@ -20,9 +20,7 @@ public class StructureOutputs: SystemResults /// The maximum beam length. /// [JsonProperty("Maximum Beam Length")] - public double MaximumBeamLength {get; set;} - - + public double MaximumBeamLength { get; set; } /// /// Construct a StructureOutputs with default inputs. @@ -30,16 +28,14 @@ public class StructureOutputs: SystemResults /// public StructureOutputs() : base() { - } - /// /// Construct a StructureOutputs specifying all inputs. /// /// [JsonConstructor] - public StructureOutputs(double maximumBeamLength): base() + public StructureOutputs(double maximumBeamLength) : base() { this.MaximumBeamLength = maximumBeamLength; diff --git a/Structure/StructureByEnvelope/dependencies/ViewScope.g.cs b/Structure/StructureByEnvelope/dependencies/ViewScope.g.cs index 0b008159..aeff1468 100644 --- a/Structure/StructureByEnvelope/dependencies/ViewScope.g.cs +++ b/Structure/StructureByEnvelope/dependencies/ViewScope.g.cs @@ -27,18 +27,20 @@ namespace Elements public partial class ViewScope : Element { [JsonConstructor] - public ViewScope(BBox3 @boundingBox, Camera @camera, bool? @lockRotation, bool? @clipWithBoundingBox, bool? @modal, System.Collections.Generic.IDictionary @functionVisibility, IList @actions, System.Guid @id = default, string @name = null) + public ViewScope(BBox3 @boundingBox, Camera @camera, bool? @lockRotation, bool? @clipWithBoundingBox, ViewScopeClippingBehavior? @clippingBehavior, bool? @modal, System.Collections.Generic.IDictionary @functionVisibility, IList @actions, System.Guid @id = default, string @name = null) : base(id, name) { this.BoundingBox = @boundingBox; this.Camera = @camera; this.LockRotation = @lockRotation; this.ClipWithBoundingBox = @clipWithBoundingBox; + this.ClippingBehavior = @clippingBehavior; this.Modal = @modal; this.FunctionVisibility = @functionVisibility; this.Actions = @actions; } + // Empty constructor public ViewScope() : base() @@ -61,6 +63,11 @@ public ViewScope() [JsonProperty("Clip With Bounding Box", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public bool? ClipWithBoundingBox { get; set; } + /// When clipping with this box, which sides should actually do the clipping? If null, all six sides will be assumed. Front is assumed to be the side facing -Y, Top is the side facing +Z + [JsonProperty("Clipping Behavior", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public ViewScopeClippingBehavior? ClippingBehavior { get; set; } + /// If true, when the user exits this scope, they'll return to their previous camera settings. [JsonProperty("Modal", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public bool? Modal { get; set; } diff --git a/Structure/StructureByEnvelope/dependencies/ViewScopeClippingBehavior.g.cs b/Structure/StructureByEnvelope/dependencies/ViewScopeClippingBehavior.g.cs new file mode 100644 index 00000000..ad91bfb4 --- /dev/null +++ b/Structure/StructureByEnvelope/dependencies/ViewScopeClippingBehavior.g.cs @@ -0,0 +1,58 @@ +//---------------------- +// +// Generated using the NJsonSchema v10.1.21.0 (Newtonsoft.Json v13.0.0.0) (http://NJsonSchema.org) +// +//---------------------- +using Elements; +using Elements.GeoJSON; +using Elements.Geometry; +using Elements.Geometry.Solids; +using Elements.Spatial; +using Elements.Validators; +using Elements.Serialization.JSON; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using Line = Elements.Geometry.Line; +using Polygon = Elements.Geometry.Polygon; + +namespace Elements +{ + #pragma warning disable // Disable all warnings + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")] + public enum ViewScopeClippingBehavior + { + [System.Runtime.Serialization.EnumMember(Value = @"All")] + All = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"TopAndBottom")] + TopAndBottom = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"Top")] + Top = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"Bottom")] + Bottom = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"FrontAndBack")] + FrontAndBack = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"Front")] + Front = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"Back")] + Back = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"LeftAndRight")] + LeftAndRight = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"Left")] + Left = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"Right")] + Right = 9, + + } +} \ No newline at end of file diff --git a/Structure/StructureByEnvelope/hypar.json b/Structure/StructureByEnvelope/hypar.json index 388f69e1..d750928a 100644 --- a/Structure/StructureByEnvelope/hypar.json +++ b/Structure/StructureByEnvelope/hypar.json @@ -4,6 +4,7 @@ "name": "Structure", "description": "Generates a structural frame from a set of Levels and an Envelope.", "language": "C#", + "stream_model": true, "model_dependencies": [ { "autohide": true, diff --git a/Structure/StructureByEnvelope/src/Function.g.cs b/Structure/StructureByEnvelope/src/Function.g.cs index fe2c01d6..f4fa0f0e 100644 --- a/Structure/StructureByEnvelope/src/Function.g.cs +++ b/Structure/StructureByEnvelope/src/Function.g.cs @@ -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; @@ -19,9 +18,9 @@ public class Function { // Cache the model store for use by subsequent // executions of this lambda. - private IModelStore store; + private UrlModelStore store; - public async Task Handler(StructureInputs args, ILambdaContext context) + public async Task Handler(StructureInputs args) { // Preload dependencies (if they exist), // so that they are available during model deserialization. @@ -62,10 +61,11 @@ public async Task Handler(StructureInputs args, ILambdaContext if(this.store == null) { - this.store = new S3ModelStore(RegionEndpoint.GetBySystemName("us-west-1")); + this.store = new UrlModelStore(); } + - var l = new InvocationWrapper(store, Structure.Execute); + var l = new InvocationWrapper (store, Structure.Execute); var output = await l.InvokeAsync(args); return output; } diff --git a/Structure/StructureByEnvelope/test/StructureTests.cs b/Structure/StructureByEnvelope/test/StructureTests.cs index 07778d5f..3850dfee 100644 --- a/Structure/StructureByEnvelope/test/StructureTests.cs +++ b/Structure/StructureByEnvelope/test/StructureTests.cs @@ -34,8 +34,6 @@ public void StructureTest() 0.1254, false, maximumNeighborSpan: 2, - bucketName: "", - uploadsBucket: "", modelInputKeys: new Dictionary(), gltfKey: "", elementsKey: "", ifcKey: ""); var outputs = Structure.Execute( new Dictionary