public CrossJoint_DoubleBackcut(List <Element> elements, Factory.JointCondition jc) : base(elements, jc)
 {
     Offset1      = DefaultOffset1;
     Offset2      = DefaultOffset2;
     Extension    = DefaultExtension;
     OffsetCentre = DefaultOffsetCentre;
 }
Esempio n. 2
0
        public VBeamJoint(List <Element> elements, Factory.JointCondition jc) : base()
        {
            if (jc.Parts.Count != Parts.Length)
            {
                throw new Exception("VBeamJoint needs 3 elements.");
            }
            var c = jc.Parts[0].Case | (jc.Parts[1].Case << 1) | (jc.Parts[2].Case << 2);

            int[] indices;
            switch (c)
            {
            case (1):
                indices = new int[] { 1, 2, 0 };
                break;

            case (2):
                indices = new int[] { 0, 2, 1 };
                break;

            case (4):
                indices = new int[] { 0, 1, 2 };
                break;

            default:
                indices = new int[] { 0, 1, 2 };
                break;
            }

            for (int i = 0; i < Parts.Length; ++i)
            {
                Parts[i] = new JointPart(elements, jc.Parts[indices[i]], this);
            }
        }
Esempio n. 3
0
 public SpliceJoint(List <Element> elements, Factory.JointCondition jc)
 {
     if (jc.Parts.Count != Parts.Length)
     {
         throw new Exception("SpliceJoint needs 2 elements.");
     }
     for (int i = 0; i < Parts.Length; ++i)
     {
         Parts[i] = new JointPart(elements, jc.Parts[i], this);
     }
 }
Esempio n. 4
0
        public FourWayJoint(List <Element> elements, Factory.JointCondition jc)
        {
            if (jc.Parts.Count != Parts.Length)
            {
                throw new Exception("FourWayJoint needs 4 elements.");
            }

            // Sort elements around the joint normal
            var vectors = new List <Vector3d>();
            var normal  = Vector3d.Zero;

            for (int i = 0; i < jc.Parts.Count; ++i)
            {
                var tan = GluLamb.Joints.JointUtil.GetEndConnectionVector((elements[jc.Parts[i].Index] as BeamElement).Beam, jc.Position);
                vectors.Add(tan);
            }
            for (int i = 0; i < vectors.Count; ++i)
            {
                int ii = (i + 1).Modulus(4);

                normal += Vector3d.CrossProduct(vectors[i], vectors[ii]);
            }

            normal /= vectors.Count;

            List <int> indices;

            Utility.SortVectorsAroundPoint(vectors, jc.Position, normal, out indices);

            for (int i = 0; i < Parts.Length; ++i)
            {
                Parts[i] = new JointPart(elements, jc.Parts[indices[i]], this);
            }

            var xaxis = Vector3d.CrossProduct(normal, Vector3d.ZAxis);

            if (xaxis.IsTiny(0.001))
            {
                xaxis = Vector3d.XAxis;
            }
            var yaxis = Vector3d.CrossProduct(xaxis, normal);

            this.Plane = new Plane(jc.Position, xaxis, yaxis);
        }
Esempio n. 5
0
 public ButtJoint1(List <Element> elements, Factory.JointCondition jc) : base(elements, jc)
 {
 }
Esempio n. 6
0
 public VBeam_ThruTenon1(List <Element> elements, Factory.JointCondition jc) : base(elements, jc)
 {
 }