private StatCrossSection GetWbeamStatCrossSection(sFrame jb, StatMaterial mat) { double a; double tw; double d; double tf; double bf; double nw; double ix; double sx; double rx; double zx; double iy; double sy; double ry; double zy; double rts; double ho; double j; double c; var t = jb; jb.crossSection.GetWBeamDimensions(jb.crossSection.shapeName, out a, out tw, out d, out tf, out bf, out nw, out ix, out sx, out rx, out zx, out iy, out sy, out ry, out zy, out rts, out ho, out j, out c); StatCrossSection cs = new StatCrossSection(jb.crossSection.shapeName, mat); //cs.Wbeam(d * 0.0254, bf * 0.0254, tf * 0.0254, tw * 0.0254); double ijFac = 4.162314256E-07; double areaFac = 0.00064516; cs.Generic(a * areaFac, ix * ijFac, iy * ijFac, j * ijFac); return(cs); }
public void ApplyLineLoadsByPattern(string patternName) { foreach (StatBeam stb in this.FEsystem.Beams) { sFrame sb = stb.ExtraData as sFrame; if (sb != null) { if (sb.lineLoads != null && sb.lineLoads.Count > 0) { sXYZ load = sXYZ.Zero(); //sXYZ moment = sXYZ.Zero(); //double scalar = 0.0; foreach (sLineLoad ll in sb.lineLoads) { if (ll.loadPatternName == patternName) { load += ll.load_Force; //moment += ll.load_Moment; //scalar += ll.load_Scalar; } } if (load.GetLength() > 0.0) { stb.AppliedLinearLoad = new C_vector(load.X, load.Y, load.Z); } } } } }
private StatCrossSection GetHSSRectangleStatCrossSection(sFrame jb, StatMaterial mat) { double w; ///list of variables double d; double t; double ar; double ix; double sx; double rx; double zx; double iy; double sy; double ry; double zy; double jt; double ct; double nw; jb.crossSection.GetHSSRecDimensions(jb.crossSection.shapeName, out w, out d, out t, out ar, out ix, out sx, out rx, out zx, out iy, out sy, out ry, out zy, out jt, out ct, out nw); StatCrossSection cs = new StatCrossSection(jb.crossSection.shapeName, mat); //cs.RectangleHollow(w * 0.0254, d * 0.0254, t * 0.0254); double ijFac = 4.162314256E-07; double areaFac = 0.00064516; cs.Generic(ar * areaFac, ix * ijFac, iy * ijFac, jt * ijFac); return(cs); }
public StatCrossSection ToStatCrossSection(sFrame jb, bool minuteDensity = false) { StatCrossSection cs = null; StatMaterial mat = GetStatMaterial(jb, minuteDensity); if (jb.crossSection.sectionType == eSectionType.AISC_I_BEAM) { cs = GetWbeamStatCrossSection(jb, mat); } else if (jb.crossSection.sectionType == eSectionType.HSS_REC) { cs = GetHSSRectangleStatCrossSection(jb, mat); } else if (jb.crossSection.sectionType == eSectionType.HSS_ROUND) { cs = GetHSSRoundStatCrossSection(jb, mat); } else if (jb.crossSection.sectionType == eSectionType.SQUARE) { cs = GetSquareStatCrossSection(jb, mat); } else if (jb.crossSection.sectionType == eSectionType.RECTANGLAR) { cs = GetRectangleStatCrossSection(jb, mat); } else if (jb.crossSection.sectionType == eSectionType.ROUND) { cs = GetRoundCrossSection(jb, mat); } return(cs); }
protected override void SolveInstance(IGH_DataAccess DA) { sFrame sb = null; if (!DA.GetData(0, ref sb)) { return; } string modelUnit = Rhino.RhinoDoc.ActiveDoc.ModelUnitSystem.ToString(); sRhinoConverter rhcon = new sRhinoConverter("Meters", modelUnit); List <sFixity> fixs = new List <sFixity>(); fixs.Add(sb.fixityAtStart); fixs.Add(sb.fixityAtEnd); List <sLineLoad> lls = new List <sLineLoad>(); if (sb.lineLoads != null && sb.lineLoads.Count > 0) { lls = rhcon.EnsureUnit(sb.lineLoads).ToList(); } DA.SetData(0, sb.frameName); DA.SetData(1, sb.frameID); DA.SetData(2, (Line)rhcon.EnsureUnit(rhcon.ToRhinoLine(sb.axis))); DA.SetData(3, sb.crossSection); DA.SetData(4, rhcon.ToRhinoVector3d(sb.upVector)); DA.SetDataList(5, lls); DA.SetDataList(6, fixs); }
public static object To_DynamoObj_sBeamPreview(sFrame beam) { sDynamoConverter dyncon = new sDynamoConverter("Meters", "Feet"); return(new Dictionary <string, object> { { "beamPreview", dyncon.EnsureUnit(dyncon.ToDynamoBeamPreview(beam)) } }); }
public Brep ToRhinoBeamPreview(sFrame sb) { Curve profileS = ToRhinoCrosssectionProfile(sb, 0.0); Curve profileE = ToRhinoCrosssectionProfile(sb, 1.0); Curve[] profiles = new Curve[2] { profileS, profileE }; return(Brep.CreateFromLoft(profiles, Point3d.Unset, Point3d.Unset, LoftType.Straight, false)[0]); }
private StatMaterial GetStatMaterial(sFrame jb, bool minuteDensity = false) { StatMaterial mat = null; if (jb.crossSection.material.materialType.ToString().Contains("STEEL")) { //mat = new StatMaterial(MATERIALTYPES.STEEL, "StatSteel"); mat = new StatMaterial(MATERIALTYPES.GENERIC, "StatSteel"); mat.Em = 1.999E11; mat.Gm = 7.69E10; if (minuteDensity) { mat.Density = 0.000000001; } else { mat.Density = 7849.0474; } mat.Poisson = 0.3; } else if (jb.crossSection.material.materialType.ToString().Contains("ALUMINUM")) { mat = new StatMaterial(MATERIALTYPES.ALUMINUM, "StatAluminum"); } else if (jb.crossSection.material.materialType.ToString().Contains("CONCRETE")) { mat = new StatMaterial(MATERIALTYPES.CONCRETE, "StatConcrete"); } else if (jb.crossSection.material.materialType.ToString().Contains("CARBONFRP")) { mat = new StatMaterial(MATERIALTYPES.CARBONFRP, "StatConcrete"); } else if (jb.crossSection.material.materialType.ToString().Contains("OAK")) { mat = new StatMaterial(MATERIALTYPES.OAK, "StatConcrete"); } else if (jb.crossSection.material.materialType.ToString().Contains("STAINLESSSTEEL")) { mat = new StatMaterial(MATERIALTYPES.STAINLESSSTEEL, "StatConcrete"); } else if (jb.crossSection.material.materialType.ToString().Contains("Isotropic")) { mat = new StatMaterial(MATERIALTYPES.GENERIC, "StatIsotropic"); //how to assure unit?? // mat.Em = jb.crossSection.material.E; mat.Density = jb.crossSection.material.massPerVol; //what else?? } return(mat); }
public static object To_DynamoObj_sBeam(sFrame beam) { sDynamoConverter dyncon = new sDynamoConverter("Meters", "Feet"); return(new Dictionary <string, object> { { "beamName", beam.frameName }, { "beamID", beam.frameID }, { "beamLine", dyncon.EnsureUnit(dyncon.ToDynamoLine(beam.axis)) }, { "crossSection", beam.crossSection }, { "lineLoads", beam.lineLoads } }); }
public void ApplyLineLoadsByCombo(string comboName, ref double deadFactor) { sLoadCombination combo = GetLoadComboByName(comboName); foreach (StatBeam stb in this.FEsystem.Beams) { sFrame sb = stb.ExtraData as sFrame; if (sb != null) { if (sb.lineLoads != null && sb.lineLoads.Count > 0) { sLineLoad comboLoad = new sLineLoad(); if (combo.combinationType == eCombinationType.LinearAdditive) { for (int i = 0; i < combo.patterns.Count; ++i) { string pattern = combo.patterns[i]; double factor = combo.factors[i]; if (pattern != "DEAD") { sb.UpdateLineLoadByPatternFactor_LinearAdditive(pattern, factor, ref comboLoad); } else { deadFactor = factor; } } } //else what? if (comboLoad.load_Force != null || comboLoad.load_Moment != null) { if (comboLoad.load_Force != null) { stb.AppliedLinearLoad = new C_vector(comboLoad.load_Force.X, comboLoad.load_Force.Y, comboLoad.load_Force.Z); } if (comboLoad.load_Moment != null) { stb.AppliedLinearLoad = new C_vector(comboLoad.load_Moment.X, comboLoad.load_Moment.Y, comboLoad.load_Moment.Z); } } if (comboLoad.load_Scalar > 0.0) { } } } } }
private Dyn.BoundingBox ToDynamoBoundingBox(List <IsObject> sobjs) { List <Dyn.Geometry> dygeos = new List <Autodesk.DesignScript.Geometry.Geometry>(); foreach (IsObject so in sobjs) { if (so is sFrame) { sFrame sb = so as sFrame; dygeos.Add(ToDynamoLine(sb.axis)); } } Dyn.BoundingBox dbox = Dyn.BoundingBox.ByGeometryCoordinateSystem(dygeos, Dyn.CoordinateSystem.ByOrigin(0, 0, 0)); dygeos.Clear(); return(dbox); }
protected override void SolveInstance(IGH_DataAccess DA) { sFrame sb = null; if (!DA.GetData(0, ref sb)) { return; } string modelUnit = Rhino.RhinoDoc.ActiveDoc.ModelUnitSystem.ToString(); sRhinoConverter rhcon = new sRhinoConverter("Meters", modelUnit); Brep bb = rhcon.EnsureUnit(rhcon.ToRhinoBeamPreview(sb)) as Brep; DA.SetData(0, sb.frameName); DA.SetData(1, sb.frameID); DA.SetData(2, bb); }
private StatCrossSection GetRectangleStatCrossSection(sFrame jb, StatMaterial mat) { StatCrossSection cs = new StatCrossSection(jb.crossSection.shapeName, mat); //currently cannot trust Millipede if (jb.crossSection.dimensions.Count > 0) { if (jb.crossSection.dimensions.Count == 2) { double wid = jb.crossSection.dimensions[0]; double dep = jb.crossSection.dimensions[1]; double area; double iyy; double izz; double jxx; GetRectangularSolidProperties(wid, dep, out area, out iyy, out izz, out jxx); //no factor as it is calculated in metric cs.Generic(area, iyy, izz, jxx); //cs.RectangleSolid(jb.crossSection.dimensions[0], jb.crossSection.dimensions[1]); } else if (jb.crossSection.dimensions.Count == 3) { double wid = jb.crossSection.dimensions[0]; double dep = jb.crossSection.dimensions[1]; double th = jb.crossSection.dimensions[2]; double area; double iyy; double izz; double jxx; GetRectangularHollowProperties(wid, dep, th, out area, out iyy, out izz, out jxx); //no factor as it is calculated in metric cs.Generic(area, iyy, izz, jxx); //cs.RectangleHollow(jb.crossSection.dimensions[0], jb.crossSection.dimensions[1], jb.crossSection.dimensions[2]); } } return(cs); }
public Curve ToRhinoCrosssectionProfile(sFrame sb, double t) { sCrossSection scs = sb.crossSection; List <sXYZ> vertice = new List <sXYZ>(); sPlane secPlane = new sPlane(sb.axis.PointAt(t), sb.localPlane.Xaxis, sb.localPlane.Yaxis); if (scs.sectionType == eSectionType.AISC_I_BEAM) { vertice = scs.GetWbeamFaceVertices(secPlane).ToList(); } else if (scs.sectionType == eSectionType.HSS_REC) { vertice = scs.GetHSSRecFaceVertices_Simple(secPlane); } else if (scs.sectionType == eSectionType.HSS_ROUND) { vertice = scs.GetHSSRoundFaceVertices_Simple(secPlane); } else if (scs.sectionType == eSectionType.RECTANGLAR) { vertice = scs.GetRecFaceVertices_Simple(secPlane); } else if (scs.sectionType == eSectionType.SQUARE) { vertice = scs.GetSquareFaceVertices_Simple(secPlane); } else if (scs.sectionType == eSectionType.ROUND) { vertice = scs.GetRoundFaceVertices_Simple(secPlane); } Polyline pl = new Polyline(); for (int i = 0; i < vertice.Count; ++i) { pl.Add(this.ToRhinoPoint3d(vertice[i])); } pl.Add(this.ToRhinoPoint3d(vertice[0])); Curve profile = pl.ToNurbsCurve(); return(profile); }
private StatCrossSection GetRoundCrossSection(sFrame jb, StatMaterial mat) { StatCrossSection cs = new StatCrossSection(jb.crossSection.shapeName, mat); if (jb.crossSection.dimensions.Count > 0) { if (jb.crossSection.dimensions.Count == 1) { double or = jb.crossSection.dimensions[0] * 0.5; cs.CircSolid(or); } else if (jb.crossSection.dimensions.Count == 2) { double or = jb.crossSection.dimensions[0] * 0.5; double ir = (jb.crossSection.dimensions[0] * 0.5) - jb.crossSection.dimensions[1]; cs.CircHollow(ir, or); } } return(cs); }
public void EnsureBeamElement() { if (this.frames.Count == 0) { sCurve bc = this.parentCrv; if (bc.curveType == eCurveType.LINE) { sLine ln = bc as sLine; //??? UPVECTOR??? this.AddBeamElement(new sLine(ln.startPoint, ln.PointAt(0.5)), sXYZ.Zaxis(), 0); this.AddBeamElement(new sLine(ln.PointAt(0.5), ln.endPoint), sXYZ.Zaxis(), 1); } } else if (this.frames.Count == 1) { sFrame sTemp = this.frames[0].DuplicatesFrame(); this.frames.Clear(); this.AddBeamElement(new sLine(sTemp.axis.startPoint, sTemp.axis.PointAt(0.5)), sTemp.upVector, 0); this.AddBeamElement(new sLine(sTemp.axis.PointAt(0.5), sTemp.axis.endPoint), sTemp.upVector, 1); } }
internal Dyn.PolyCurve ToRhinoCrosssectionProfile(sFrame sb, double t) { sCrossSection scs = sb.crossSection; List <sXYZ> vertice = new List <sXYZ>(); sPlane secPlane = new sPlane(sb.axis.PointAt(t), sb.localPlane.Xaxis, sb.localPlane.Yaxis); if (scs.sectionType == eSectionType.AISC_I_BEAM) { vertice = scs.GetWbeamFaceVertices(secPlane).ToList(); } else if (scs.sectionType == eSectionType.HSS_REC) { vertice = scs.GetHSSRecFaceVertices_Simple(secPlane); } else if (scs.sectionType == eSectionType.HSS_ROUND) { vertice = scs.GetHSSRoundFaceVertices_Simple(secPlane); } else if (scs.sectionType == eSectionType.RECTANGLAR) { vertice = scs.GetRecFaceVertices_Simple(secPlane); } else if (scs.sectionType == eSectionType.SQUARE) { vertice = scs.GetSquareFaceVertices_Simple(secPlane); } else if (scs.sectionType == eSectionType.ROUND) { vertice = scs.GetRoundFaceVertices_Simple(secPlane); } List <Dyn.Point> dpts = new List <Autodesk.DesignScript.Geometry.Point>(); for (int i = 0; i < vertice.Count; ++i) { dpts.Add(this.ToDynamoPoint(vertice[i])); } return(Dyn.PolyCurve.ByPoints(dpts, true)); }
public void AddBeamElement(sLine sln, sXYZ upvec, int id) { sFrame sb = new sFrame(sln, upvec.DuplicatesXYZ()); sb.parentGuid = this.objectGUID; sb.frameName = this.frameSetName + "_" + this.setId + "_" + id; sb.frameID = id; sb.crossSection = this.crossSection; //load if (this.lineLoads != null) { sb.lineLoads = new List <sLineLoad>(); foreach (sLineLoad ll in this.lineLoads) { sb.lineLoads.Add(ll.DuplicatesLineLoad()); } } this.frames.Add(sb); }
private StatCrossSection GetHSSRoundStatCrossSection(sFrame jb, StatMaterial mat) { double od; double th; double a; double i; double s; double r; double z; double j; double c; double nw; jb.crossSection.GetHSSRoundDimensions(jb.crossSection.shapeName, out od, out th, out a, out i, out s, out r, out z, out j, out c, out nw); StatCrossSection cs = new StatCrossSection(jb.crossSection.shapeName, mat); //cs.RectangleHollow(w * 0.0254, d * 0.0254, t * 0.0254); double ijFac = 4.162314256E-07; double areaFac = 0.00064516; cs.Generic(a * areaFac, i * ijFac, i * ijFac, j * ijFac); return(cs); }
internal Dyn.Solid ToDynamoBeamPreview(sFrame sb) { return(Dyn.Solid.ByLoft(new Dyn.Curve[2] { ToRhinoCrosssectionProfile(sb, 0.0), ToRhinoCrosssectionProfile(sb, 1.0) })); }
protected override void SolveInstance(IGH_DataAccess DA) { sFrame sb = null; if (!DA.GetData(0, ref sb)) { return; } string modelUnit = Rhino.RhinoDoc.ActiveDoc.ModelUnitSystem.ToString(); sRhinoConverter rhcon = new sRhinoConverter("Meters", modelUnit); this.Message = "Beam Result\n" + colMode.ToString(); sRange ran = sb.GetBeamResultRange(colMode); Point3d cp = rhcon.EnsureUnit(rhcon.ToRhinoPoint3d(sb.axis.PointAt(0.5))); Vector3d x = rhcon.ToRhinoVector3d(sb.localPlane.Xaxis); Vector3d y = rhcon.ToRhinoVector3d(sb.localPlane.Yaxis); Plane pl = new Plane(cp, x, -y); double max = 0.0; double min = 0.0; string unit = ""; if (colMode == eColorMode.Deflection) { max = rhcon.EnsureUnit_Deflection(ran.max); min = rhcon.EnsureUnit_Deflection(ran.min); if (modelUnit == "Meters") { unit = "mm"; } else if (modelUnit == "Feet") { unit = "in"; } } else if (colMode.ToString().Contains("Stress")) { max = rhcon.EnsureUnit_Stress(ran.max); min = rhcon.EnsureUnit_Stress(ran.min); if (modelUnit == "Meters") { max *= 1.0E-6; min *= 1.0E-6; unit = "MPa"; } else if (modelUnit == "Feet") { unit = "ksi"; } } else if (colMode.ToString().Contains("Force")) { max = rhcon.EnsureUnit_Force(ran.max); min = rhcon.EnsureUnit_Force(ran.min); if (modelUnit == "Meters") { unit = "N"; } else if (modelUnit == "Feet") { unit = "lbf"; } } else if (colMode.ToString().Contains("Moment")) { max = rhcon.EnsureUnit_Moment(ran.max); min = rhcon.EnsureUnit_Moment(ran.min); if (modelUnit == "Meters") { unit = "N.m"; } else if (modelUnit == "Feet") { unit = "lbf.ft"; } } DA.SetData(0, pl); DA.SetData(1, "(" + Math.Round(min, 2) + ") - (" + Math.Round(max, 2) + ") " + unit); DA.SetData(2, max); DA.SetData(3, min); }
private void AwaresBeamResult(sFrame sb, ref sResultRange bsRe, double dataLenTol) { StatBeamResults br = new StatBeamResults(); sStatConverter conv = new sStatConverter(); StatBeam b = sb.extraData as StatBeam; b.RecoverForces(); sb.beamWeight = b.Weight; sb.results = new List <sFrameResult>(); double len = sb.axis.length; int count = (int)(len / dataLenTol); if (count < 1) { count = 1; } double step = 1.0 / (double)(count); for (int i = 0; i < count + 1; ++i) { double tNow = step * i; br.t = tNow; b.GetInterpolatedResultsAt(new C_vector(0, 0, -1), this.FEsystem.DeadLoadFactor, br); sFrameResult bre = new sFrameResult(); bre.moment = new sXYZ(br.MomentL.x, br.MomentL.y, br.MomentL.z); bre.force = new sXYZ(-br.ForceL.x, br.ForceL.y, br.ForceL.z); /// force X negate????????? bre.deflection_mm = conv.TosXYZ(b.Csys.LocalToGlobalVector(br.DeflL * 1000)); bre.deflectionLocal_mm = conv.TosXYZ(br.DeflL * 1000); bre.parameterAt = tNow; sPlane secPlane = new sPlane(sb.axis.PointAt(tNow), sb.localPlane.Xaxis, sb.localPlane.Yaxis); List <sXYZ> secVertices = new List <sXYZ>(); if (sb.crossSection.sectionType == eSectionType.AISC_I_BEAM) { secVertices = sb.crossSection.GetWbeamFaceVertices(secPlane).ToList(); } else if (sb.crossSection.sectionType == eSectionType.HSS_REC) { secVertices = sb.crossSection.GetHSSRecFaceVertices_Simple(secPlane).ToList(); } else if (sb.crossSection.sectionType == eSectionType.HSS_ROUND) { secVertices = sb.crossSection.GetHSSRoundFaceVertices_Simple(secPlane).ToList(); } else if (sb.crossSection.sectionType == eSectionType.SQUARE) { secVertices = sb.crossSection.GetSquareFaceVertices_Simple(secPlane).ToList(); } else if (sb.crossSection.sectionType == eSectionType.RECTANGLAR) { secVertices = sb.crossSection.GetRecFaceVertices_Simple(secPlane).ToList(); } else if (sb.crossSection.sectionType == eSectionType.ROUND) { secVertices = sb.crossSection.GetRoundFaceVertices_Simple(secPlane).ToList(); } if (secVertices != null) { for (int j = 0; j < secVertices.Count; ++j) { sXYZ svp = secVertices[j]; sXYZ localDir = svp - sb.axis.PointAt(tNow); sXYZ ToLocalZ = localDir.ProjectTo(secPlane.Zaxis); sXYZ ToLocalY = localDir.ProjectTo(secPlane.Yaxis); double len_ToLocalZ = ToLocalZ.Z; // vertical like double len_ToLocalY = ToLocalY.Y; // horizontal like br.zL = len_ToLocalZ; // vertical like br.yL = len_ToLocalY; // horizontal like double axialStress_X = (br.ForceL.x / b.CrossSection.Area); //double axialStress_Y = ??; //double axialStress_Z = ??; double MyStress = ((br.MomentL.y * br.zL) / b.CrossSection.Iyy); double MzStress = ((br.MomentL.z * br.yL) / b.CrossSection.Izz); //double MxStress = ?? double stressTest = axialStress_X + MyStress - MzStress; //why negate?...(StatBeamResult does this) //do I need? //b.GetSectionPointResult(br); sFrameSectionResult secRe = new sFrameSectionResult(); secRe.location = svp; secRe.deflection_mm = conv.TosXYZ(b.Csys.LocalToGlobalVector(br.DeflL * 1000)); secRe.stress_Combined = Math.Abs(stressTest); secRe.stress_Axial_X = axialStress_X; secRe.stress_Moment_Y = MyStress; secRe.stress_Moment_Z = MzStress; bre.sectionResults.Add(secRe); } } bsRe.UpdateMaxValues(bre); sb.results.Add(bre); } }