From 2824653e7f87d385383ad268e4f1c4df27397379 Mon Sep 17 00:00:00 2001 From: Isak Naslund Date: Mon, 4 Mar 2024 12:08:36 +0100 Subject: [PATCH 1/5] Update Description.cs --- Structure_Engine/Query/Description.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Structure_Engine/Query/Description.cs b/Structure_Engine/Query/Description.cs index 24250ae2b..866a17860 100644 --- a/Structure_Engine/Query/Description.cs +++ b/Structure_Engine/Query/Description.cs @@ -356,6 +356,32 @@ public static string Description(this Ribbed property) /***************************************************/ + [Description("Generates a default description for the SurfaceProperty.")] + [Input("property", "The SurfaceProperty to get a default description for.")] + [Output("desc", "The generated description for the property based on its dimensions, material and type.")] + public static string Description(this BuiltUpRibbed property) + { + if (property == null) + return "null property"; + + return $"Ribbed: {property.TopThickness:G3} THK slab {CheckGetMaterialName(property.Material)} on {property.RibHeight:G3}x{property.RibThickness:G3} ribs {CheckGetMaterialName(property.RibMaterial ?? property.Material)} spaced {property.RibSpacing:G3}"; + } + + /***************************************************/ + + [Description("Generates a default description for the SurfaceProperty.")] + [Input("property", "The SurfaceProperty to get a default description for.")] + [Output("desc", "The generated description for the property based on its dimensions, material and type.")] + public static string Description(this Cassette property) + { + if (property == null) + return "null property"; + + return $"Cassette Top: {property.TopThickness:G3} THK {CheckGetMaterialName(property.Material)} Bot: {property.BottomThickness:G3} THK {CheckGetMaterialName(property.BottomMaterial ?? property.Material)} Ribs: {property.RibHeight:G3}x{property.RibThickness:G3} {CheckGetMaterialName(property.RibMaterial ?? property.Material)} spaced {property.RibSpacing:G3}"; + } + + /***************************************************/ + [Description("Generates a default description for the SurfaceProperty as 'Ribbed DepthX DepthY SpacingX SpacingY StemWidthX StemWidthY - MaterialName'.")] [Input("property", "The SurfaceProperty to get a default description for.")] [Output("desc", "The generated description for the property based on its dimensions, material and type.")] From 31b1309a73ad3383a5c6b1eed9b0fef1c4e86b61 Mon Sep 17 00:00:00 2001 From: Isak Naslund Date: Mon, 4 Mar 2024 12:08:43 +0100 Subject: [PATCH 2/5] Update TotalThickness.cs --- Structure_Engine/Query/TotalThickness.cs | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Structure_Engine/Query/TotalThickness.cs b/Structure_Engine/Query/TotalThickness.cs index b47d7234f..99ef4c3f5 100644 --- a/Structure_Engine/Query/TotalThickness.cs +++ b/Structure_Engine/Query/TotalThickness.cs @@ -172,6 +172,33 @@ public static double TotalThickness(this ToppedSlab property) return property.BaseProperty.ITotalThickness() + property.ToppingThickness; } + /***************************************************/ + + [Description("Gets the total thickness of the surface property.")] + [Input("property", "The property to evaluate.")] + [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + public static double TotalThickness(this Cassette property) + { + if (property.IsNull()) + return 0; + + return property.TopThickness + property.BottomThickness + property.RibHeight; + } + + /***************************************************/ + + [Description("Gets the total thickness of the surface property.")] + [Input("property", "The property to evaluate.")] + [Output("TotalThickness", "The total thickness, including any ribs or waffling.", typeof(Length))] + public static double TotalThickness(this BuiltUpRibbed property) + { + if (property.IsNull()) + return 0; + + return property.TopThickness + property.RibHeight; + } + + /***************************************************/ /**** Public Methods - Interfaces ****/ /***************************************************/ From 319c7cc0c385b0c71e02a2cfa567d942a300e53d Mon Sep 17 00:00:00 2001 From: Isak Naslund Date: Mon, 4 Mar 2024 12:08:50 +0100 Subject: [PATCH 3/5] Update VolumePerArea.cs --- Structure_Engine/Query/VolumePerArea.cs | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/Structure_Engine/Query/VolumePerArea.cs b/Structure_Engine/Query/VolumePerArea.cs index 25775443f..90ac55127 100644 --- a/Structure_Engine/Query/VolumePerArea.cs +++ b/Structure_Engine/Query/VolumePerArea.cs @@ -254,6 +254,46 @@ public static double VolumePerArea(this ToppedSlab property) return property.BaseProperty.IVolumePerArea() + property.ToppingThickness; } + /***************************************************/ + + [Description("Gets the volume per area of the property for the purpose of calculating solid volume.")] + [Input("property", "The property to evaluate the volume per area of.")] + [Output("volumePerArea", "The volume per area of the property for the purpose of calculating solid volume.", typeof(Length))] + public static double VolumePerArea(this Cassette property) + { + if (property.IsNull()) + return double.NaN; + + if (property.RibThickness <= 0 || property.RibSpacing < property.RibThickness) + { + Base.Compute.RecordError($"The {nameof(Cassette.RibThickness)} is 0 or {nameof(Cassette.RibSpacing)} smaller than {nameof(Cassette.RibThickness)}. The {nameof(Cassette)} is invalid and volume cannot be computed."); + return double.NaN; + } + + double volPerAreaRibZone = property.RibHeight * (property.RibThickness / property.RibSpacing); + return property.TopThickness + property.BottomThickness + volPerAreaRibZone; + } + + + /***************************************************/ + + [Description("Gets the volume per area of the property for the purpose of calculating solid volume.")] + [Input("property", "The property to evaluate the volume per area of.")] + [Output("volumePerArea", "The volume per area of the property for the purpose of calculating solid volume.", typeof(Length))] + public static double VolumePerArea(this BuiltUpRibbed property) + { + if (property.IsNull()) + return double.NaN; + + if (property.RibThickness <= 0 || property.RibSpacing < property.RibThickness) + { + Base.Compute.RecordError($"The {nameof(BuiltUpRibbed.RibThickness)} is 0 or {nameof(BuiltUpRibbed.RibSpacing)} smaller than {nameof(BuiltUpRibbed.RibThickness)}. The {nameof(BuiltUpRibbed)} is invalid and volume cannot be computed."); + return double.NaN; + } + + double volPerAreaRibZone = property.RibHeight * (property.RibThickness / property.RibSpacing); + return property.TopThickness + volPerAreaRibZone; + } /***************************************************/ /**** Public Methods - Interfaces ****/ /***************************************************/ From e261684e79f5e513502cefe1cefafd48d04e2e9d Mon Sep 17 00:00:00 2001 From: Isak Naslund Date: Mon, 4 Mar 2024 12:08:54 +0100 Subject: [PATCH 4/5] Update MassPerArea.cs --- Structure_Engine/Query/MassPerArea.cs | 47 ++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/Structure_Engine/Query/MassPerArea.cs b/Structure_Engine/Query/MassPerArea.cs index 2b43331a1..c1345d533 100644 --- a/Structure_Engine/Query/MassPerArea.cs +++ b/Structure_Engine/Query/MassPerArea.cs @@ -135,12 +135,57 @@ public static double MassPerArea(this CorrugatedDeck property) [PreviousInputNames("property","loadingPanelProperty")] [Description("Gets the mass per area for a LoadingPanelProperty. This will always return 0.")] [Input("property", "The LoadingPanelProperty property to calculate the mass per area for.")] - [Output("massPerArea", "The mass per area for the property. THis will always return 0 for a LoadingPanelProperty.", typeof(MassPerUnitArea))] + [Output("massPerArea", "The mass per area for the property. This will always return 0 for a LoadingPanelProperty.", typeof(MassPerUnitArea))] public static double MassPerArea(this LoadingPanelProperty property) { return 0; } + + /***************************************************/ + + [Description("Gets the mass per area for a Cassette.")] + [Input("property", "The Cassette property to calculate the mass per area for.")] + [Output("massPerArea", "The mass per area for the property.", typeof(MassPerUnitArea))] + public static double MassPerArea(this Cassette property) + { + if (property.IsNull() || property.Material.IsNull()) + return double.NaN; + + if (property.RibThickness <= 0 || property.RibSpacing < property.RibThickness) + { + Base.Compute.RecordError($"The {nameof(Cassette.RibThickness)} is 0 or {nameof(Cassette.RibSpacing)} smaller than {nameof(Cassette.RibThickness)}. The {nameof(Cassette)} is invalid and mass per area cannot be computed."); + return double.NaN; + } + + double volPerAreaRibZone = property.RibHeight * (property.RibThickness / property.RibSpacing); + return property.TopThickness * property.Material.Density + + property.BottomThickness * (property.BottomMaterial ?? property.Material).Density + + volPerAreaRibZone * (property.RibMaterial ?? property.Material).Density; + } + + /***************************************************/ + + [Description("Gets the mass per area for a BuiltUpRibbed.")] + [Input("property", "The BuiltUpRibbed property to calculate the mass per area for.")] + [Output("massPerArea", "The mass per area for the property.", typeof(MassPerUnitArea))] + public static double MassPerArea(this BuiltUpRibbed property) + { + if (property.IsNull() || property.Material.IsNull()) + return double.NaN; + + if (property.RibThickness <= 0 || property.RibSpacing < property.RibThickness) + { + Base.Compute.RecordError($"The {nameof(BuiltUpRibbed.RibThickness)} is 0 or {nameof(BuiltUpRibbed.RibSpacing)} smaller than {nameof(BuiltUpRibbed.RibThickness)}. The {nameof(BuiltUpRibbed)} is invalid and mass per area cannot be computed."); + return double.NaN; + } + + double volPerAreaRibZone = property.RibHeight * (property.RibThickness / property.RibSpacing); + return property.TopThickness * property.Material.Density + + volPerAreaRibZone * (property.RibMaterial ?? property.Material).Density; + } + + /***************************************************/ /**** Public Methods - Interfaces ****/ /***************************************************/ From e4b8fb56e8ce513a2eab34e7eda8383ab0693dba Mon Sep 17 00:00:00 2001 From: Isak Naslund Date: Mon, 4 Mar 2024 12:09:00 +0100 Subject: [PATCH 5/5] Update MaterialComposition.cs --- Structure_Engine/Query/MaterialComposition.cs | 59 ++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/Structure_Engine/Query/MaterialComposition.cs b/Structure_Engine/Query/MaterialComposition.cs index c828a8628..6b91be6a6 100644 --- a/Structure_Engine/Query/MaterialComposition.cs +++ b/Structure_Engine/Query/MaterialComposition.cs @@ -253,6 +253,62 @@ public static MaterialComposition MaterialComposition(this SlabOnDeck property, ); } + /***************************************************/ + + [Description("Returns a SurfaceProperty's MaterialComposition.")] + [Input("property", "The SurfaceProperty to query.")] + [Input("reinforcementDensity", "ReinforcementDensity assigned to the panel.")] + [Output("materialComposition", "The MaterialComposition of the SurfaceProperty.")] + public static MaterialComposition MaterialComposition(this Cassette property, ReinforcementDensity reinforcementDensity = null) + { + if (property.IsNull() || property.Material.IsNull()) + return null; + + //If only main material provided, use it for all parts + if (property.RibMaterial == null && property.BottomMaterial == null) + return property.Material.MaterialComposition(reinforcementDensity); + + IMaterialFragment topMat = property.Material; + IMaterialFragment bottomMat = property.BottomMaterial ?? property.Material; + IMaterialFragment ribMat = property.RibMaterial ?? property.Material; + double volPerAreaRibZone = property.RibHeight * (property.RibThickness / property.RibSpacing); + + return Matter.Compute.AggregateMaterialComposition(new List + { + topMat.MaterialComposition(reinforcementDensity), + bottomMat.MaterialComposition(reinforcementDensity), + ribMat.MaterialComposition(reinforcementDensity) + }, + new List { property.TopThickness, property.BottomThickness, volPerAreaRibZone }); + } + + /***************************************************/ + + [Description("Returns a SurfaceProperty's MaterialComposition.")] + [Input("property", "The SurfaceProperty to query.")] + [Input("reinforcementDensity", "ReinforcementDensity assigned to the panel.")] + [Output("materialComposition", "The MaterialComposition of the SurfaceProperty.")] + public static MaterialComposition MaterialComposition(this BuiltUpRibbed property, ReinforcementDensity reinforcementDensity = null) + { + if (property.IsNull() || property.Material.IsNull()) + return null; + + //If only main material provided, use it for all parts + if (property.RibMaterial == null) + return property.Material.MaterialComposition(reinforcementDensity); + + IMaterialFragment topMat = property.Material; + IMaterialFragment ribMat = property.RibMaterial ?? property.Material; + double volPerAreaRibZone = property.RibHeight * (property.RibThickness / property.RibSpacing); + return Matter.Compute.AggregateMaterialComposition(new List + { + topMat.MaterialComposition(reinforcementDensity), + ribMat.MaterialComposition(reinforcementDensity) + }, + new List { property.TopThickness, volPerAreaRibZone }); + } + + /***************************************************/ [Description("Returns a Pile's homogeneous MaterialComposition.")] @@ -352,7 +408,7 @@ private static MaterialComposition MaterialComposition(this ISurfaceProperty pro private static MaterialComposition MaterialComposition(this IMaterialFragment baseMaterial, ReinforcementDensity reinforcementDensity) { - if (reinforcementDensity.Material == null || reinforcementDensity.Material.Density == 0 || reinforcementDensity.Density == 0) + if (reinforcementDensity?.Material == null || reinforcementDensity.Material.Density == 0 || reinforcementDensity.Density == 0) return (MaterialComposition)Physical.Create.Material(baseMaterial); if (reinforcementDensity.Material.Density < 0) @@ -380,6 +436,7 @@ private static MaterialComposition MaterialComposition(this IMaterialFragment ba /***************************************************/ + } }