private static double WarpingConstant(this SectionProperty property) { if (property is SectionProperty) { SteelSection steelSection = property as SteelSection; double b1 = steelSection.B1; double b2 = steelSection.B2; double tf1 = steelSection.Tf1; double tf2 = steelSection.Tf2; double tw = steelSection.Tw; switch (steelSection.Shape) { case ShapeType.ISection: if (tf1 == tf2 && b1 == b2) { return(tf1 * System.Math.Pow(steelSection.TotalDepth - tf1, 2) * System.Math.Pow(steelSection.TotalWidth, 3) / 24); } else { return(tf1 * System.Math.Pow(steelSection.TotalDepth - (tf1 + tf2) / 2, 2) / 12 * (System.Math.Pow(b1, 3) * System.Math.Pow(b2, 3) / (System.Math.Pow(b1, 3) + System.Math.Pow(b2, 3)))); } case ShapeType.Channel: return(tf1 * System.Math.Pow(steelSection.TotalDepth, 2) / 12 * (3 * b1 * tf1 + 2 * steelSection.TotalDepth * tw / (6 * b1 * tf1 + steelSection.TotalDepth * tw))); default: return(0); } } return(0); }
public static void Calculate(this SectionProperty property) { List <Slice> verticalSlices = Integration.CreateSlices(property.Edges, Vector.XAxis()); List <Slice> horizontalSlices = Integration.CreateSlices(property.Edges, Vector.YAxis()); Point min = property.Edges.Bounds().Min; Point max = property.Edges.Bounds().Max; double centreY = 0; double centreX = 0; property.Area = Integration.IntegrateArea(horizontalSlices, 1, min.Y, max.Y, ref centreY); Integration.IntegrateArea(verticalSlices, 1, min.X, max.X, ref centreX); property.TotalWidth = max.X - min.X; property.TotalDepth = max.Y - min.Y; property.Iy = Integration.IntegrateArea(verticalSlices, 1, 2, 1, centreX); property.Iz = Integration.IntegrateArea(horizontalSlices, 1, 2, 1, centreY); property.Sy = 2 * Integration.IntegrateArea(verticalSlices, 1, 1, 1, min.X, centreX); property.Sz = 2 * Integration.IntegrateArea(verticalSlices, 1, 1, 1, min.Y, centreY); property.Rgy = System.Math.Sqrt(property.Iy / property.Area); property.Rgz = System.Math.Sqrt(property.Iz / property.Area); property.Vy = max.X - centreX; property.Vpy = centreX - min.X; property.Vz = max.Y - centreY; property.Vpz = centreY - min.Y; property.Zz = property.Iz / property.Vy; property.Zy = property.Iy / property.Vz; property.J = property.TorsionContant(); property.Iw = property.WarpingConstant(); property.Asy = ShearArea(verticalSlices, property.Iz, centreX); property.Asz = ShearArea(horizontalSlices, property.Iy, centreY); }
public static double DepthAt(this SectionProperty prop, double x, ref double[] range) { Slice slice = Integration.GetSliceAt(prop.Edges, x, 1, Plane.YZ()); range = slice.Placement; return(slice.Length); }
public void CreateProperty(string Name, string Value) { SectionProperty NewProperty = new SectionProperty(); NewProperty.Name = Name; NewProperty.Value = Value; Properties.Add(NewProperty); }
/// <summary> /// Create an I Shaped section property /// </summary> /// <param name="mType"></param> /// <param name="widthTopFlange"></param> /// <param name="widthBotFlange"></param> /// <param name="totalDepth"></param> /// <param name="flangeThicknessTop"></param> /// <param name="flangeThicknessBot"></param> /// <param name="webThickness"></param> /// <param name="webRadius"></param> /// <param name="toeRadius"></param> /// <returns></returns> public static SectionProperty NewISection(MaterialType matType, double widthTopFlange, double widthBotFlange, double totalDepth, double flangeThicknessTop, double flangeThicknessBot, double webThickness, double webRadius, double toeRadius) { SectionProperty section = CreateSection(matType); if (matType == MaterialType.Steel) { (section as SteelSection).SetSectionData(totalDepth, System.Math.Max(widthTopFlange, widthBotFlange), webThickness, flangeThicknessTop, webRadius, toeRadius, 0, widthTopFlange, widthBotFlange, flangeThicknessBot); } section.SetGeometry(ShapeType.ISection, totalDepth, System.Math.Max(widthTopFlange, widthBotFlange), webThickness, flangeThicknessTop, webRadius, toeRadius, widthTopFlange, widthBotFlange, flangeThicknessBot); section.Shape = ShapeType.ISection; return(section); }
public static SectionProperty NewTeeSection(MaterialType matType, double totalDepth, double totalwidth, double flangeThickness, double webThickness, double r1 = 0, double r2 = 0) { SectionProperty section = CreateSection(matType); if (matType == MaterialType.Steel) { (section as SteelSection).SetSectionData(totalDepth, totalwidth, webThickness, flangeThickness, r1, r2); } section.SetGeometry(ShapeType.Tee, totalDepth, totalwidth, webThickness, flangeThickness, r1, r2); section.Shape = ShapeType.Tee; return(section); }
public static SectionProperty NewCustomSection(MaterialType matType, BH.oM.Geometry.Group <Curve> edges) { SectionProperty section = CreateSection(matType); //section.SectionData = CreateSectionData(totalDepth, totalwidth, webThickness, flangeThickness, r1, r2); section.Edges = edges; if (matType == MaterialType.Steel) { (section as SteelSection).SetSectionData(); } return(section); }
/// <summary> /// create a circular section /// </summary> /// <param name="mType"></param> /// <param name="diameter"></param> /// <returns></returns> public static SectionProperty NewTubeSection(MaterialType matType, double diameter, double thickness) { SectionProperty section = CreateSection(matType); if (matType == MaterialType.Steel) { (section as SteelSection).SetSectionData(diameter, diameter, thickness, thickness, 0, 0); } section.SetGeometry(ShapeType.Tube, diameter, diameter, thickness, thickness, 0, 0); section.Shape = ShapeType.Tube; return(section); }
/// <summary> /// create a circular section /// </summary> /// <param name="mType"></param> /// <param name="diameter"></param> /// <returns></returns> public static SectionProperty NewCircularSection(MaterialType matType, double diameter) { SectionProperty section = CreateSection(matType); if (matType == MaterialType.Steel) { (section as SteelSection).SetSectionData(diameter, diameter, 0, 0, 0, 0); } section.SetGeometry(ShapeType.Circle, diameter, diameter, 0, 0, 0, 0); section.Shape = ShapeType.Circle; return(section);// new SteelSection(ShapeType.Box, height, width, tw, tf, outerRadius, innerRadius); }
/// <summary> /// Create an angle section /// </summary> /// <param name="mType"></param> /// <param name="height"></param> /// <param name="width"></param> /// <param name="flangeThickness"></param> /// <param name="webThickness"></param> /// <returns></returns> public static SectionProperty NewAngleSection(MaterialType matType, double height, double width, double flangeThickness, double webThickness, double webRadius, double toeRadius) { SectionProperty section = CreateSection(matType); if (matType == MaterialType.Steel) { (section as SteelSection).SetSectionData(height, width, webThickness, flangeThickness, webRadius, toeRadius); } section.SetGeometry(ShapeType.Angle, height, width, webThickness, flangeThickness, webRadius, toeRadius); section.Shape = ShapeType.Angle; return(section); }
/// <summary> /// Create a rectangular shaped section /// </summary> /// <param name="mType"></param> /// <param name="height"></param> /// <param name="width"></param> /// <param name="outerRadius"></param> /// <returns></returns> public static SectionProperty NewBoxSection(MaterialType matType, double height, double width, double tf, double tw, double outerRadius = 0, double innerRadius = 0) { SectionProperty section = CreateSection(matType); if (matType == MaterialType.Steel) { (section as SteelSection).SetSectionData(height, width, tw, tf, outerRadius, innerRadius); } section.SetGeometry(ShapeType.Box, height, width, tw, tf, outerRadius, innerRadius); section.Shape = ShapeType.Box; return(section);// new SteelSection(ShapeType.Box, height, width, tw, tf, outerRadius, innerRadius); }
/// <summary> /// Create a rectangular shaped section /// </summary> /// <param name="mType"></param> /// <param name="height"></param> /// <param name="width"></param> /// <param name="outerRadius"></param> /// <returns></returns> public static SectionProperty NewRectangularSection(MaterialType matType, double height, double width, double outerRadius = 0) { SectionProperty section = CreateSection(matType); if (matType == MaterialType.Steel) { (section as SteelSection).SetSectionData(height, width, 0, 0, outerRadius, 0); } section.SetGeometry(ShapeType.Rectangle, height, width, 0, 0, outerRadius, 0); section.Shape = ShapeType.Rectangle; return(section); }
/***************************************************/ public static double Value(SectionProperty a, SectionProperty b) //TODO { double weight = 0; if (a.Shape == b.Shape) { weight += 0.5; } weight += 0.5 * Value(a.Material, b.Material); return(weight); }
public static SectionProperty NewSection(Group <Curve> edges, ShapeType type, MaterialType matType) { SectionProperty property = null; switch (matType) { case BH.oM.Materials.MaterialType.Steel: return(new SteelSection(edges, type)); case BH.oM.Materials.MaterialType.Concrete: return(new ConcreteSection(edges, type)); default: property = new SteelSection(edges, type); property.Material = Materials.Create.Default(matType); return(property); } }
public static SectionProperty CreateSection(MaterialType matType) { SectionProperty property = null; switch (matType) { case BH.oM.Materials.MaterialType.Steel: return(new SteelSection()); case BH.oM.Materials.MaterialType.Concrete: return(new ConcreteSection()); default: property = new SteelSection(); property.Material = Materials.Create.Default(matType); return(property); } }
private static double TorsionContant(this SectionProperty property) { if (property is SteelSection) { SteelSection ss = property as SteelSection; double b1 = ss.B1; double b2 = ss.B2; double tf1 = ss.Tf1; double tf2 = ss.Tf2; double tw = ss.Tw; switch (ss.Shape) { case ShapeType.ISection: case ShapeType.Channel: case ShapeType.Zed: return((b1 * System.Math.Pow(tf1, 3) + b2 * System.Math.Pow(tf2, 3) + (ss.TotalDepth - tf1) * System.Math.Pow(tw, 3)) / 3); case ShapeType.Tee: case ShapeType.Angle: return(ss.TotalWidth * System.Math.Pow(tf1, 3) + ss.TotalDepth * System.Math.Pow(tw, 3)); case ShapeType.Circle: return(System.Math.PI * System.Math.Pow(ss.TotalDepth, 4) / 2); case ShapeType.Box: return(2 * tf1 * tw * System.Math.Pow(ss.TotalWidth - tw, 2) * System.Math.Pow(ss.TotalDepth - tf1, 2) / (ss.TotalWidth * tw + ss.TotalDepth * tf1 - System.Math.Pow(tw, 2) - System.Math.Pow(tf1, 2))); case ShapeType.Tube: return(System.Math.PI * (System.Math.Pow(ss.TotalDepth, 4) - System.Math.Pow(ss.TotalDepth - tw, 4)) / 2); default: return(0); } } return(0); }
private static void SetGeometry(this SectionProperty section, ShapeType shapeType, double height, double width, double tw, double tf1, double r1, double r2, double mass = 0, double b1 = 0, double b2 = 0, double tf2 = 0, double b3 = 0, double spacing = 0) { BH.oM.Geometry.Group <BH.oM.Geometry.Curve> edges = null; switch (shapeType) { case ShapeType.ISection: edges = ShapeBuilder.CreateISecction(tf1, b1 == 0 ? width : b1, tf2 == 0 ? tf1 : tf2, b2 == 0 ? width : b2, tw, height - 2 * tf1, r1, r2); break; case ShapeType.Tee: edges = ShapeBuilder.CreateTee(tf1, b1 == 0 ? width : b1, tw, height - tf1, r1, r2); break; case ShapeType.Box: edges = ShapeBuilder.CreateBox(width, height, tw, tf1, r1, r2); break; case ShapeType.Angle: edges = ShapeBuilder.CreateAngle(width, height, tf1, tw, r1, r2); break; case ShapeType.Circle: edges = ShapeBuilder.CreateCircle(width / 2); break; case ShapeType.Rectangle: edges = ShapeBuilder.CreateRectangle(width, height, r1); break; case ShapeType.Tube: edges = ShapeBuilder.CreateTube(width / 2, tw); break; } section.Edges = edges; }
SetValue(SectionProperty, value);
public bool Read(string FilePath) { ClearVars(); //To Do: read from file FileStream kFs = new FileStream(FilePath, FileMode.Open, FileAccess.ReadWrite); StreamReader sr = new StreamReader(kFs); string str = ""; while (sr.EndOfStream == false) { str = sr.ReadLine(); if (BasicInfo.UsersTitle == "") { if (str.Contains("ASTRA")) { if (str.Length > 12) { str = str.Remove(0, 12); BasicInfo.UsersTitle = str; continue; } } } //if (ProjectTitle == "") //{ // ProjectTitle = str; // continue; //} if (str.Contains("UNIT") && this.LUnit == "" && this.MUnit == "") { string[] ss = CAstraUnits.GetBasicLengthMassUnits(str); this.MUnit = ss[0]; this.LUnit = ss[1]; switch (this.MUnit.ToUpper()) { case "MTON": this.wfct_flag = 1; break; case "KN": this.wfct_flag = 2; break; case "KG": this.wfct_flag = 3; break; case "NEW": this.wfct_flag = 4; break; case "N": this.wfct_flag = 4; break; case "GM": this.wfct_flag = 5; break; case "GMS": this.wfct_flag = 5; break; case "KIP": this.wfct_flag = 6; break; case "LBS": this.wfct_flag = 7; break; } switch (this.LUnit.ToUpper()) { case "MM": this.lfct_flag = 1; break; case "CM": this.lfct_flag = 2; break; case "M": this.lfct_flag = 3; break; case "ME": this.lfct_flag = 3; break; case "METRES": this.lfct_flag = 3; break; case "YDS": this.lfct_flag = 4; break; case "FT": this.lfct_flag = 5; break; case "INCH": this.lfct_flag = 6; break; case "IN": this.lfct_flag = 6; break; } } if (str.ToUpper().Contains("STRUCTURE")) { str = str.Replace('\t', ' '); string[] values = str.Split(new char[] { ' ' }); while (str.IndexOf(" ") != -1) { str = str.Replace(" ", " "); } if (values.Length == 3) { int.Parse(values[1]); BasicInfo.Type = (StructureType)int.Parse(values[1]); BasicInfo.RunningOption = short.Parse(values[2]); } //str = str.Remove(0, 10); //str = str.Trim(); //string[] values = str.Split(new char[] { ' ' }); //while (str.IndexOf(" ") != -1) //{ // str = str.Replace(" ", " "); //} //str = str.Replace('\t', ' '); //values = str.Split(new char[] { ' ' }); //str = values[0]; //StructureType = ((str == "1") ? StructureType.SPACE : (str == "2") ? StructureType.FLOOR : StructureType.PLANE); //try { this.Modex = short.Parse(values[1]); } //catch (Exception ex) { this.Modex = -1; } } string find = getNodeName(str); if (find == "N000") { str = str.Replace('\t', ' '); string[] values = str.Split(new char[] { ' ' }); while (str.IndexOf(" ") != -1) { str = str.Replace(" ", " "); } if (values.Length == 3) { BasicInfo.MassUnit = CAstraUnits.GetMassUnit(values[1]); BasicInfo.LengthUnit = CAstraUnits.GetLengthUnit(values[2]); } } if (find == "N001") { if (str.Contains("UNIT")) { double[] d = CAstraUnits.GetLengthMassUnits(str); NodeData.MassFactor = d[0]; NodeData.LengthFactor = d[1]; string[] unt = CAstraUnits.GetUnits(str); BasicInfo.MassUnit = CAstraUnits.GetMassUnit(unt[0]); BasicInfo.LengthUnit = CAstraUnits.GetLengthUnit(unt[1]); NodeData.MassUnit = CAstraUnits.GetMassUnit(unt[2]); NodeData.LengthUnit = CAstraUnits.GetLengthUnit(unt[3]); } try { NodeData.Add(CNodeData.Parse(str)); } catch (Exception ex) { } } else if (find == "N002") { if (str.Contains("UNIT")) { double[] d = CAstraUnits.GetLengthMassUnits(str); BeamConnectivity.MassFactor = d[0]; BeamConnectivity.LengthFactor = d[1]; } try { BeamConnectivity.Add(CMemberConnectivity.Parse(str)); } catch (Exception ex) { } } else if (find == "N003") { if (str.Contains("UNIT")) { double[] d = CAstraUnits.GetLengthMassUnits(str); SectionProperty.MassFactor = d[0]; SectionProperty.LengthFactor = d[1]; string[] unt = CAstraUnits.GetUnits(str); //BasicInfo.MassUnit = CAstraUnits.GetMassUnit(unt[0]); //BasicInfo.LengthUnit = CAstraUnits.GetLengthUnit(unt[1]); SectionProperty.MassUnit = CAstraUnits.GetMassUnit(unt[2]); SectionProperty.LengthUnit = CAstraUnits.GetLengthUnit(unt[3]); } try { SectionProperty.Add(CSectionProperty.Parse(str)); } catch (Exception ex) { } } else if (find == "N004") { if (str.Contains("UNIT")) { double[] d = CAstraUnits.GetLengthMassUnits(str); MaterialProperty.MassFactor = d[0]; MaterialProperty.LengthFactor = d[1]; string[] unt = CAstraUnits.GetUnits(str); //BasicInfo.MassUnit = CAstraUnits.GetMassUnit(unt[0]); //BasicInfo.LengthUnit = CAstraUnits.GetLengthUnit(unt[1]); MaterialProperty.MassUnit = CAstraUnits.GetMassUnit(unt[2]); MaterialProperty.LengthUnit = CAstraUnits.GetLengthUnit(unt[3]); } try { MaterialProperty.Add(CMaterialProperty.Parse(str)); } catch (Exception ex) { } } else if (find == "N005") { try { Support.Add(CSupport.Parse(str)); } catch (Exception ex) { } } else if (find == "N008") { try { MemberTruss.Add(CMemberTruss.Parse(str)); } catch (Exception ex) { } } else if (find == "N010") { try { SelfWeight = (CSelfWeight.Parse(str)); } catch (Exception ex) { } } else if (find == "N007") { if (str.Contains("UNIT")) { double[] d = CAstraUnits.GetLengthMassUnits(str); MemberBeamLoad.MassFactor = d[0]; MemberBeamLoad.LengthFactor = d[1]; string[] unt = CAstraUnits.GetUnits(str); //BasicInfo.MassUnit = CAstraUnits.GetMassUnit(unt[0]); //BasicInfo.LengthUnit = CAstraUnits.GetLengthUnit(unt[1]); MemberBeamLoad.MassUnit = CAstraUnits.GetMassUnit(unt[2]); MemberBeamLoad.LengthUnit = CAstraUnits.GetLengthUnit(unt[3]); } try { MemberBeamLoad.Add(CMemberBeamLoading.Parse(str)); } catch (Exception ex) { } } else if (find == "N009") { try { BeamConnectivityRelease.Add(CBeamConnectivityRelease.Parse(str)); } catch (Exception ex) { } } else if (find == "N006") { if (str.Contains("UNIT")) { double[] d = CAstraUnits.GetLengthMassUnits(str); JointNodalLoad.MassFactor = d[0]; JointNodalLoad.LengthFactor = d[1]; string[] unt = CAstraUnits.GetUnits(str); //BasicInfo.MassUnit = CAstraUnits.GetMassUnit(unt[0]); //BasicInfo.LengthUnit = CAstraUnits.GetLengthUnit(unt[1]); JointNodalLoad.MassUnit = CAstraUnits.GetMassUnit(unt[2]); JointNodalLoad.LengthUnit = CAstraUnits.GetLengthUnit(unt[3]); } try { //CJointNodalLoad jntLoad = new CJointNodalLoad(); //jntLoad = CJointNodalLoad.Parse(str); JointNodalLoad.Add(CJointNodalLoad.Parse(str)); } catch (Exception ex) { } } else if (find == "N099") { try { Analysis = CAnalysis.Parse(str); } catch (Exception ex) { } } else if (find == "N011") { if (str.Contains("FILE")) { int j = str.IndexOf("FILE"); str = str.Remove(0, j + 5); str = str.ToUpper().Trim(); MovingLoad.FileName = str; } try { MovingLoad.Add(CMovingLoad.Parse(str)); } catch (Exception ex) { } } else if (find == "N012") { string[] values = str.Split(new char[] { ' ' }); if (values.Length == 4) { try { LoadGeneration.repeatTime = int.Parse(values[3]); } catch (Exception ex) { } } try { LoadGeneration.Add(CLoadGeneration.Parse(str)); } catch (Exception ex) { } } else if (find == "N013") { try { LoadCombination.Add(CLoadCombination.Parse(str)); } catch (Exception ex) { } } else if (find == "N014") { if (str.Contains("UNIT")) { double[] d = CAstraUnits.GetLengthMassUnits(str); AreaLoad.MassFactor = d[0]; AreaLoad.LengthFactor = d[1]; string[] unt = CAstraUnits.GetUnits(str); //BasicInfo.MassUnit = CAstraUnits.GetMassUnit(unt[0]); //BasicInfo.LengthUnit = CAstraUnits.GetLengthUnit(unt[1]); AreaLoad.MassUnit = CAstraUnits.GetMassUnit(unt[2]); AreaLoad.LengthUnit = CAstraUnits.GetLengthUnit(unt[3]); } try { AreaLoad.Add(CAreaLoad.Parse(str)); } catch (Exception ex) { } } else if (find == "N019") { if (str.Contains("UNIT")) { double[] d = CAstraUnits.GetLengthMassUnits(str); MatPropertyInfo.MassFactor = d[0]; MatPropertyInfo.LengthFactor = d[1]; string[] unt = CAstraUnits.GetUnits(str); //BasicInfo.MassUnit = CAstraUnits.GetMassUnit(unt[0]); //BasicInfo.LengthUnit = CAstraUnits.GetLengthUnit(unt[1]); MatPropertyInfo.MassUnit = CAstraUnits.GetMassUnit(unt[2]); MatPropertyInfo.LengthUnit = CAstraUnits.GetLengthUnit(unt[3]); } try { MatPropertyInfo.Add(CMaterialPropertyInformation.Parse(str)); } catch (Exception ex) { } } else if (find == "N016") { if (str.Contains("UNIT")) { double[] d = CAstraUnits.GetLengthMassUnits(str); ElementData.MassFactor = d[0]; ElementData.LengthFactor = d[1]; string[] unt = CAstraUnits.GetUnits(str); //BasicInfo.MassUnit = CAstraUnits.GetMassUnit(unt[0]); //BasicInfo.LengthUnit = CAstraUnits.GetLengthUnit(unt[1]); ElementData.MassUnit = CAstraUnits.GetMassUnit(unt[2]); ElementData.LengthUnit = CAstraUnits.GetLengthUnit(unt[3]); } try { //ElementData.Add(CElementData.Parse(str)); } catch (Exception ex) { } } else if (find == "N020") { try { ElementMultiplier.Add(CElementMultiplier.Parse(str)); } catch (Exception ex) { } } else if (find == "N018") { try { ElementData.Add(CElementData.Parse(str)); } catch (Exception ex) { } } if (Analysis.NDYN == 2) { if (find == "N101") { try { TimeHistory.THist_1 = CTimeHistory1.Parse(str); } catch (Exception exx) { } } else if (find == "N102") { try { TimeHistory.THist_2 = CTimeHistory2.Parse(str); } catch (Exception exx) { } } else if (find == "N103") { try { TimeHistory.THist_3 = CTimeHistory3.Parse(str); } catch (Exception exx) { } } else if (find == "N104") { try { TimeHistory.THist_4 = CTimeHistory4.Parse(str); } catch (Exception exx) { } } else if (find == "N105") { try { if (TimeHistory.THist_5.Count > 0) { TimeHistory.THist_5.NodalConstraint = true; } TimeHistory.THist_5.Add(CTimeHistory5.Parse(str)); } catch (Exception exx) { } } else if (find == "N106") { try { TimeHistory.THist_6.Add(CTimeHistory6.Parse(str)); } catch (Exception exx) { } } } else if (Analysis.NDYN == 3) { Response.ReadFromStream(sr); } } kFs.Close(); sr.Close(); return(true); }
public static double DepthAt(this SectionProperty prop, double x) { Slice slice = Integration.GetSliceAt(prop.Edges, x, 1, Plane.YZ()); return(slice.Length); }
//public virtual double AreaAtDepth(double depth) //{ // Slice slice; // double area = 0; // if (depth > TotalDepth) // { // return GrossArea; // } // depth = Max(1) - depth; // for (int i = 0; i < HorizontalSlices.Count; i++) // { // slice = m_HorizontalSlices[i]; // area += slice.Width * slice.Length; // if (slice.Centre + slice.Width / 2 > depth) // { // area -= slice.Length * (slice.Centre + slice.Width / 2 - depth); // break; // } // } // return area; //} //public virtual double CentroidAtDepth(double depth) //{ // Slice slice; // double centroidArea = 0; // double area = 0; // if (depth > TotalDepth) // { // return CentreZ; // } // depth = Max(1) - depth; // for (int i = 0; i < HorizontalSlices.Count; i++) // { // slice = m_HorizontalSlices[i]; // if (slice.Centre + slice.Width / 2 < depth) // { // centroidArea += (slice.Width + slice.Length) * slice.Centre; // area += slice.Width + slice.Length; // } // else // { // double remainingWidth = slice.Width / 2 - depth + slice.Centre; // centroidArea += remainingWidth * slice.Length * (slice.Centre + (slice.Width - remainingWidth) / 2); // area += remainingWidth * slice.Length; // break; // } // } // return centroidArea / area; //} //public virtual double AreaAtWidth(double width) //{ // Slice slice; // double area = 0; // if (width > TotalWidth) // { // return GrossArea; // } // width = Max(0) - width; // for (int i = VerticalSlices.Count - 1; i > 0; i--) // { // slice = m_VerticalSlices[i]; // if (slice.Centre - slice.Width / 2 > width) // { // area += slice.Width + slice.Length; // } // else // { // area += (slice.Width / 2 - width + slice.Centre) * slice.Length; // break; // } // } // return area; //} //public virtual double CentroidAtWidth(double width) //{ // Slice slice; // double centroidArea = 0; // double area = 0; // if (width > TotalWidth) // { // return CentreY; // } // width = Max(0) - width; // for (int i = VerticalSlices.Count - 1; i > 0; i--) // { // slice = m_VerticalSlices[i]; // if (slice.Centre - slice.Width / 2 > width) // { // centroidArea += (slice.Width + slice.Length) * slice.Centre; // area += slice.Width + slice.Length; // } // else // { // double remainingWidth = slice.Width / 2 - width + slice.Centre; // centroidArea += remainingWidth * slice.Length * (slice.Centre + (slice.Width - remainingWidth) / 2); // area += remainingWidth * slice.Length; // break; // } // } // return centroidArea / area; //} public static double WidthAt(this SectionProperty prop, double y) { Slice slice = Integration.GetSliceAt(prop.Edges, y, 1, Plane.XZ()); return(slice.Length); }
public override void AddModuleDataForSection(string name, string value, SectionInfo section) { SectionProperty property = new SectionProperty( section.Identity, SectionModuleDataGroup, name, value ); try { // insert new property property.CommitChanges(); } catch (Exception) { } }