public void Beam(string testName, BeamType beamType, double startSetback, double endSetback) { this.Name = testName; ICurve cl = null; switch (beamType) { case BeamType.Line: cl = ModelTest.TestLine; break; case BeamType.Arc: cl = ModelTest.TestArc; break; case BeamType.Polygon: cl = ModelTest.TestPolygon; break; case BeamType.Polyline: cl = ModelTest.TestPolyline; break; } var framingType = new StructuralFramingType(Guid.NewGuid().ToString(), this._testProfile, BuiltInMaterials.Steel); var beam = new Beam(cl, framingType, startSetback, endSetback); Assert.Equal(BuiltInMaterials.Steel, beam.ElementType.Material); Assert.Equal(cl, beam.Curve); this.Model.AddElement(beam); }
/// <summary> /// Convert an IfcBeam to a beam. /// </summary> /// <param name="beam"></param> private static Beam ToBeam(this IfcBeam beam) { var elementTransform = beam.ObjectPlacement.ToTransform(); var solid = beam.RepresentationsOfType <IfcExtrudedAreaSolid>().FirstOrDefault(); // foreach (var cis in beam.ContainedInStructure) // { // cis.RelatingStructure.ObjectPlacement.ToTransform().Concatenate(transform); // } if (solid != null) { var solidTransform = solid.Position.ToTransform(); var c = solid.SweptArea.ToICurve(); if (c is Polygon) { var cl = new Line(Vector3.Origin, solid.ExtrudedDirection.ToVector3(), (IfcLengthMeasure)solid.Depth); var framingType = new StructuralFramingType(Guid.NewGuid().ToString(), new Profile((Polygon)c), BuiltInMaterials.Steel); var result = new Beam(solidTransform.OfLine(cl), framingType, 0.0, 0.0, elementTransform); result.Name = beam.Name; return(result); } } return(null); }
public void Example() { this.Name = "Elements_Beam"; // <example> // Create a framing type. var profile = WideFlangeProfileServer.Instance.GetProfileByName("W44x335"); var framingType = new StructuralFramingType(profile.Name, profile, BuiltInMaterials.Steel); // Create a straight beam. var line = new Line(Vector3.Origin, new Vector3(5, 0, 5)); var linearBeam = new Beam(line, framingType); // Create a polygon beam. var polygon = Polygon.Ngon(5, 2); var polygonBeam = new Beam(polygon, framingType, 0, 0, new Transform(6, 0, 0)); // Create a curved beam. var arc = new Arc(Vector3.Origin, 5.0, 45.0, 135.0); var arcBeam = new Beam(arc, framingType, 0, 0, new Transform(12, 0, 0)); // </example> this.Model.AddElement(linearBeam); this.Model.AddElement(polygonBeam); this.Model.AddElement(arcBeam); }
public void Building() { this.Name = "Building"; var elevations = new[] { 0.0, 3.0, 6.0, 9.0, 12.0, 15.0 }; var opening = new Opening(5, 5, 2, 2); var wallType = new WallType("Concrete", 0.1); var floorType = new FloorType("Concrete", 0.15); var beamType = new StructuralFramingType("Wide Flange", WideFlangeProfileServer.Instance.GetProfileByName("W36x245"), BuiltInMaterials.Steel); var site = Polygon.Ngon(6, 20.0); foreach (var el in elevations) { var slab = new Floor(site, floorType, el, null, new List <Opening>() { opening }); this.Model.AddElement(slab); var edgeBeams = slab.CreateEdgeBeams(beamType); this.Model.AddElements(edgeBeams); var segs = site.Segments(); for (var i = 0; i < segs.Length - 2; i++) { var wall = new StandardWall(slab.Transform.OfLine(segs[i]), wallType, 3.0); this.Model.AddElement(wall); } } }
public void Column() { this.Name = "Elements_Column"; var profile = WideFlangeProfileServer.Instance.GetProfileByName("W44x335"); var framingType = new StructuralFramingType(profile.Name, profile, BuiltInMaterials.Steel); var column = new Column(Vector3.Origin, 3.0, framingType); this.Model.AddElement(column); }
public void Column() { this.Name = "Column"; var framingType = new StructuralFramingType(Guid.NewGuid().ToString(), this._testProfile, BuiltInMaterials.Steel); var column = new Column(Vector3.Origin, 3.0, framingType); Assert.Equal(BuiltInMaterials.Steel, column.ElementType.Material); Assert.Equal(3.0, column.Curve.Length()); this.Model.AddElement(column); }
public void Truss() { this.Name = "Truss"; var model = new Model(); var profile = WideFlangeProfileServer.Instance.GetProfileByName("W33x387"); var framingType = new StructuralFramingType("W33x387", profile, BuiltInMaterials.Steel); var truss = new Truss(new Vector3(0, 0, 0), new Vector3(0, 30, 0), 3.0, 10, framingType, framingType, framingType, BuiltInMaterials.Steel, 0.1, 0.1); this.Model.AddElement(truss); }
public static List <Beam> CreateEdgeBeams(this Floor floor, StructuralFramingType beamType) { var beams = new List <Beam>(); foreach (var s in floor.Profile.Perimeter.Segments()) { var beam = new Beam(floor.Transform.OfLine(s), beamType, 0, 0); beams.Add(beam); } return(beams); }
public void Brace() { this.Name = "Brace"; var framingType = new StructuralFramingType(Guid.NewGuid().ToString(), this._testProfile, BuiltInMaterials.Steel); var line = new Line(Vector3.Origin, new Vector3(3, 3, 3)); var brace = new Brace(line, framingType); Assert.Equal(BuiltInMaterials.Steel, brace.ElementType.Material); Assert.Equal(line, brace.Curve); this.Model.AddElement(brace); }
public void BeamSystem() { this.Name = "BeamSystem"; var profile = new WideFlangeProfile("test", 1.0, 2.0, 0.1, 0.1); var a = new Vector3(0, 0, 0); var b = new Vector3(20, 0, 0); var d = new Vector3(20, 20, 10); var c = new Vector3(0, 20, 0); var polygon = new Polygon(new[] { a, b, c, d }); var framingType = new StructuralFramingType(Guid.NewGuid().ToString(), profile, BuiltInMaterials.Steel); var beam = new Beam(new Line(a, b), framingType); var system = new BeamSystem(5, framingType, new Line(a, b), new Line(c, d)); Assert.True(system.Elements.Count() == 5); this.Model.AddElements(system.Elements); this.Model.AddElement(beam); }
public void Serialize() { var model = new Model(); var profile = WideFlangeProfileServer.Instance.GetProfileByName("W33x387"); var framingType = new StructuralFramingType("W33x387", profile, BuiltInMaterials.Steel); var truss = new Truss(new Vector3(0, 0, 0), new Vector3(0, 10, 0), 1.0, 10, framingType, framingType, framingType, BuiltInMaterials.Steel, 0.1, 0.1); model.AddElement(truss); var json = model.ToJson(); var newModel = Model.FromJson(json); var newTruss = newModel.ElementsOfType <Truss>().FirstOrDefault(); Assert.Equal(truss.Divisions, newTruss.Divisions); Assert.Equal(truss.Depth, newTruss.Depth); Assert.Equal(truss.Start, newTruss.Start); Assert.Equal(truss.End, newTruss.End); }
public void Truss() { this.Name = "Elements_Truss"; // <example> // Create a framing type. var profile = WideFlangeProfileServer.Instance.GetProfileByName("W33x387"); var framingType = new StructuralFramingType("W33x387", profile, BuiltInMaterials.Steel); // Create a truss. var truss = new Truss(new Vector3(0, 0, 0), new Vector3(0, 30, 10), 3.0, 10, framingType, framingType, framingType, BuiltInMaterials.Steel, 0.1, 0.1); // </example> this.Model.AddElement(truss); Assert.Equal(this.Model.Elements.Count, truss.Elements.Count + 1); }
public void Serialize() { this.Name = "Truss"; var profile = WideFlangeProfileServer.Instance.GetProfileByName("W8x13"); var chordType = new StructuralFramingType("W33x387", profile, new Material("Chord", Colors.Aqua)); var webType = new StructuralFramingType("W33x387", profile, new Material("Web", Colors.Orange)); var truss = new Truss(new Vector3(0, 0, 0), new Vector3(0, 10, 0), 1.0, 10, chordType, chordType, webType, BuiltInMaterials.Steel, 0.1, 0.1); this.Model.AddElement(truss); var json = this.Model.ToJson(); var newModel = Model.FromJson(json); var newTruss = newModel.ElementsOfType <Truss>().FirstOrDefault(); Assert.Equal(truss.Divisions, newTruss.Divisions); Assert.Equal(truss.Depth, newTruss.Depth); Assert.Equal(truss.Start, newTruss.Start); Assert.Equal(truss.End, newTruss.End); }
public void Beams() { this.Name = "IfcBeams"; var pts = Hypar(5.0, 5.0); var m1 = new Material("red", Colors.Red, 0f, 0f); var m2 = new Material("green", Colors.Green, 0f, 0f); var t1 = new StructuralFramingType("W16x31", WideFlangeProfileServer.Instance.GetProfileByName("W16x31"), m1); var t2 = new StructuralFramingType("W16x31", WideFlangeProfileServer.Instance.GetProfileByName("W16x31"), m2); for (var j = 0; j < pts.Count; j++) { var colA = pts[j]; List <Vector3> colB = null; if (j + 1 < pts.Count) { colB = pts[j + 1]; } for (var i = 0; i < colA.Count; i++) { var a = colA[i]; Vector3 b = null; if (i + 1 < colA.Count) { b = colA[i + 1]; var line1 = new Line(a, b); var beam1 = new Beam(line1, t1); this.Model.AddElement(beam1); } if (colB != null) { var c = colB[i]; var line2 = new Line(a, c); var beam2 = new Beam(line2, t2); this.Model.AddElement(beam2); } } } }
public void HSS() { this.Name = "HSS"; var x = 0.0; var z = 0.0; var profiles = HSSPipeProfileServer.Instance.AllProfiles().ToList(); foreach (var profile in profiles) { var color = new Color((float)(x / 20.0), (float)(z / profiles.Count), 0.0f, 1.0f); var line = new Line(new Vector3(x, 0, z), new Vector3(x, 3, z)); var framingType = new StructuralFramingType(Guid.NewGuid().ToString(), profile, new Material(Guid.NewGuid().ToString(), color, 0.0f, 0.0f)); var beam = new Beam(line, framingType); this.Model.AddElement(beam); x += 2.0; if (x > 20.0) { z += 2.0; x = 0.0; } } }
/// <summary> /// Convert an IfcColumn to a Column. /// </summary> /// <param name="column"></param> private static Column ToColumn(this IfcColumn column) { var elementTransform = column.ObjectPlacement.ToTransform(); var solid = column.RepresentationsOfType <IfcExtrudedAreaSolid>().FirstOrDefault(); foreach (var cis in column.ContainedInStructure) { cis.RelatingStructure.ObjectPlacement.ToTransform().Concatenate(elementTransform); } if (solid != null) { var solidTransform = solid.Position.ToTransform(); var c = solid.SweptArea.ToICurve(); var framingType = new StructuralFramingType(Guid.NewGuid().ToString(), new Profile((Polygon)c), BuiltInMaterials.Steel); var result = new Column(solidTransform.Origin, (IfcLengthMeasure)solid.Depth, framingType, elementTransform, 0.0, 0.0); result.Name = column.Name; return(result); } return(null); }
public static List <Beam> ContstructBeams(double xAmp, double yAmp, int divisions, out double maxLength, out double minLength, out double minEl, out double maxEl) { minLength = double.PositiveInfinity; maxLength = double.NegativeInfinity; minEl = double.PositiveInfinity; maxEl = double.NegativeInfinity; var pts = ConstructHypar(xAmp, yAmp, divisions); var m1 = new Material("red", Colors.Yellow, 0f, 0f); var m2 = new Material("green", Colors.Blue, 0f, 0f); var t1 = new StructuralFramingType("W16x31", WideFlangeProfileServer.Instance.GetProfileByName("W16x31"), m1); var t2 = new StructuralFramingType("W16x31", WideFlangeProfileServer.Instance.GetProfileByName("W16x31"), m2); var beams = new List <Beam>(); for (var j = 0; j < pts.Count; j++) { var colA = pts[j]; List <Vector3> colB = null; if (j + 1 < pts.Count) { colB = pts[j + 1]; } for (var i = 0; i < colA.Count; i++) { var a = colA[i]; Vector3 b = null; if (i + 1 < colA.Count) { b = colA[i + 1]; var line1 = new Line(a, b); var l = line1.Length(); minLength = Math.Min(l, minLength); maxLength = Math.Max(l, maxLength); minEl = Math.Min(a.Z, minEl); minEl = Math.Min(b.Z, minEl); maxEl = Math.Max(a.Z, maxEl); maxEl = Math.Max(b.Z, maxEl); var beam1 = new Beam(line1, t1); beam1.AddProperty("length", new NumericProperty(l, UnitType.Distance)); beams.Add(beam1); } if (colB != null) { var c = colB[i]; var line2 = new Line(a, c); var l = line2.Length(); minLength = Math.Min(l, minLength); maxLength = Math.Max(l, maxLength); minEl = Math.Min(a.Z, minEl); minEl = Math.Min(c.Z, minEl); maxEl = Math.Max(a.Z, maxEl); maxEl = Math.Max(c.Z, maxEl); var beam2 = new Beam(line2, t2); beam2.AddProperty("length", new NumericProperty(l, UnitType.Distance)); beams.Add(beam2); } } } return(beams); }