Пример #1
0
        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();
            }

            return(Math.Round(angle, 3) % 180 == 0);
        }
Пример #2
0
        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));
        }
Пример #3
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 (var 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 (var connectedBeam in currentNode.ConnectedBeams.Where(b => !Member.Beams.Contains(b) && this.StabilityBraces.Contains(b)))
                {
                    // Check the connection plane and angle of the brace
                    var    checkAxis             = Axis == BeamAxis.Major ? BeamAxis.Minor : BeamAxis.Major;
                    bool   memberInPlaneWithAxis = beam.CheckIBeamInAxisPlane(connectedBeam, checkAxis);
                    double 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);
        }
Пример #4
0
 public double GetAngleRelativeToBeamAxis(Beam beam2, BeamAxis axis)
 {
     return(GetAngleRelativeToBeamAxis(this, beam2, axis));
 }