public double GetAngleRelativeToBeamAxis(Beam Beam2, BEAMAXIS Axis) { return GetAngleRelativeToBeamAxis(this, Beam2, Axis); }
public static double GetAngleRelativeToBeamAxis(Beam Beam1, Beam Beam2, BEAMAXIS Axis) { double output = 0; switch (Axis) { case BEAMAXIS.LONGITUDINAL: output = Vector3D.AngleBetween(Beam1.LongitudinalAxis, Beam2.LongitudinalAxis); break; case BEAMAXIS.MAJOR: output = Vector3D.AngleBetween(Beam1.MajorAxis, Beam2.LongitudinalAxis); break; case BEAMAXIS.MINOR: output = Vector3D.AngleBetween(Beam1.MinorAxis, Beam2.LongitudinalAxis); break; } return Math.Round(output, 6); }
public bool CheckIBeamInAxisPlane(Beam Beam, BEAMAXIS Axis) { double angle; switch (Axis) { case BEAMAXIS.MAJOR: angle = Vector3D.AngleBetween(this.MinorAxis, Vector3D.CrossProduct(this.LongitudinalAxis, Beam.LongitudinalAxis)); break; case BEAMAXIS.MINOR: angle = Vector3D.AngleBetween(this.MajorAxis, Vector3D.CrossProduct(this.LongitudinalAxis, Beam.LongitudinalAxis)); break; default: throw new NotImplementedException(); } var test = Math.Round(angle, 3) % 180; return Math.Round(angle, 3) % 180 == 0; }
private IEnumerable<BucklingLength> CalculateMemberBucklingLengths(Member Member, BEAMAXIS Axis) { Node currentNode; BucklingLength currentBucklingLength; List<BucklingLength> bucklingLengths; MEMBERCLASS memberClass; bucklingLengths = new List<BucklingLength>(); memberClass = this.DetermineMemberClass(Member); currentNode = Member.StartNode; currentBucklingLength = new BucklingLength(); foreach (Beam beam in Member.Beams) { currentBucklingLength.Beams.Add(beam); // Determine the next node in case one of the beams is flipped currentNode = (currentNode == beam.StartNode) ? beam.EndNode : beam.StartNode; // Loop through connected beams to see if one of them is a stability brace foreach (Beam connectedBeam in currentNode.ConnectedBeams.Where(b => !Member.Beams.Contains(b) && this.StabilityBraces.Contains(b))) { double connectionAngle; bool memberInPlaneWithAxis; BEAMAXIS checkAxis; // Check the connection plane and angle of the brace checkAxis = Axis == BEAMAXIS.MAJOR ? BEAMAXIS.MINOR : BEAMAXIS.MAJOR; memberInPlaneWithAxis = beam.CheckIBeamInAxisPlane(connectedBeam, checkAxis); connectionAngle = Math.Abs((beam.GetAngleRelativeToBeamAxis(connectedBeam, checkAxis) + 90) % 180 - 90); // Split the member if the brace connects in the correct place or within 45 of that plane if (memberInPlaneWithAxis || (!memberInPlaneWithAxis && connectionAngle <= 45)) { if (currentBucklingLength.Beams.Count > 1) bucklingLengths.Add(currentBucklingLength); currentBucklingLength = new BucklingLength(); break; } } } if (currentBucklingLength.Beams.Count > 1) bucklingLengths.Add(currentBucklingLength); bucklingLengths.ForEach(bl => bl.Member = Member); return bucklingLengths; }