Ejemplo n.º 1
0
        //translate karamba nodal supports to rfem nodal supports
        // since in karamba every nodal support is an independent class instance and
        // in rfem only different types of nodal supports need an class instance and
        // the supports are saved as node list inside of the instance. We need to
        // do some modifications while doing to translation.
        private static NodalSupport[] Supports(List <Karamba.Supports.Support> kSupports)
        {
            Dictionary <List <Boolean>, NodalSupport> supportList = new Dictionary <List <Boolean>, NodalSupport>();
            int i = 1;

            foreach (Karamba.Supports.Support kSupport in kSupports)
            {
                if (!supportList.ContainsKey(kSupport._condition))
                {
                    NodalSupport rSupport = new NodalSupport();
                    rSupport.No = i;
                    SupportConditions(ref rSupport, kSupport);
                    rSupport.NodeList = (kSupport.node_ind + 1).ToString();
                    i++;
                    supportList.Add(kSupport._condition, rSupport);
                }
                else
                {
                    NodalSupport rSupport = supportList[kSupport._condition];
                    rSupport.NodeList += "," + (kSupport.node_ind + 1).ToString();
                    supportList[kSupport._condition] = rSupport;
                }
            }
            return(supportList.Values.ToArray());
        }
Ejemplo n.º 2
0
 public RFSupportP(NodalSupport support, List <Plane> orientation)
 {
     NodeList = support.NodeList;
     Comment  = support.Comment;
     ID       = support.ID;
     IsValid  = support.IsValid;
     No       = support.No;
     Tag      = support.Tag;
     Rx       = support.RestraintConstantX / 1000;
     Ry       = support.RestraintConstantY / 1000;
     Rz       = support.RestraintConstantZ / 1000;
     Tx       = support.SupportConstantX / 1000;
     Ty       = support.SupportConstantY / 1000;
     Tz       = support.SupportConstantZ / 1000;
     RSType   = support.ReferenceSystem;
     if (support.UserDefinedReferenceSystem.Type == UserDefinedAxisSystemType.RotatedSystemType)
     {
         UDSType = UserDefinedAxisSystemType.RotatedSystemType;
         RSeq    = support.UserDefinedReferenceSystem.RotationSequence;
         RotX    = support.UserDefinedReferenceSystem.RotationAngles.X;
         RotY    = support.UserDefinedReferenceSystem.RotationAngles.Y;
         RotZ    = support.UserDefinedReferenceSystem.RotationAngles.Z;
     }
     //UDAxisSystem = support.UserDefinedReferenceSystem;
     // UDAxisSystemType = UDAxisSystem.Type;
     Orientation = orientation;
     ToModify    = false;
     ToDelete    = false;
     SetOrientation();
     //}
     //public RFSupportP(NodalSupport support, Point3d[] location) : this(support, location, new Plane(Plane.WorldXY))
     //{
 }
Ejemplo n.º 3
0
        //Changes karamba support conditions to rfem support conditions
        private static void SupportConditions(ref NodalSupport rSupport, Karamba.Supports.Support kSupport)
        {
            if (kSupport._condition[0])
            {
                rSupport.SupportConstantX = -1;
            }
            else
            {
                rSupport.SupportConstantX = 0;
            }

            if (kSupport._condition[1])
            {
                rSupport.SupportConstantY = -1;
            }
            else
            {
                rSupport.SupportConstantY = 0;
            }

            if (kSupport._condition[2])
            {
                rSupport.SupportConstantZ = -1;
            }
            else
            {
                rSupport.SupportConstantZ = 0;
            }

            if (kSupport._condition[3])
            {
                rSupport.RestraintConstantX = -1;
            }
            else
            {
                rSupport.RestraintConstantX = 0;
            }

            if (kSupport._condition[4])
            {
                rSupport.RestraintConstantY = -1;
            }
            else
            {
                rSupport.RestraintConstantY = 0;
            }

            if (kSupport._condition[5])
            {
                rSupport.RestraintConstantZ = -1;
            }
            else
            {
                rSupport.RestraintConstantZ = 0;
            }
        }
Ejemplo n.º 4
0
 public SupportInf(List <Point3d> pointList, NodalSupport support)
 {
     Points  = pointList;
     Support = support;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            List <Point3d> ghPoints     = new List <Point3d>();
            Vector3d       transSprints = new Vector3d(0, 0, 0);
            Vector3d       rotSprints   = new Vector3d(0, 0, 0);

            //TODO planes Not Implemented
            //Plane locPlane = Plane.WorldXY;


            DA.GetDataList(0, ghPoints);
            DA.GetData(1, ref transSprints);
            DA.GetData(2, ref rotSprints);

            //TODO Planes not implemented yet.
            //DA.GetData(3, ref locPlane);

            Attributes_Custom ca      = m_attributes as Attributes_Custom;
            NodalSupport      support = new NodalSupport();

            if (!ca.SelectedButtons[0])
            {
                support.SupportConstantX = transSprints.X * 1000;
            }
            else
            {
                support.SupportConstantX = -1;
            }
            if (!ca.SelectedButtons[1])
            {
                support.SupportConstantY = transSprints.Y * 1000;
            }
            else
            {
                support.SupportConstantY = -1;
            }
            if (!ca.SelectedButtons[2])
            {
                support.SupportConstantZ = transSprints.Z * 1000;
            }
            else
            {
                support.SupportConstantZ = -1;
            }
            if (!ca.SelectedButtons[3])
            {
                support.RestraintConstantX = rotSprints.X * 1000;
            }
            else
            {
                support.RestraintConstantX = -1;
            }
            if (!ca.SelectedButtons[4])
            {
                support.RestraintConstantY = rotSprints.Y * 1000;
            }
            else
            {
                support.RestraintConstantY = -1;
            }
            if (!ca.SelectedButtons[5])
            {
                support.RestraintConstantZ = rotSprints.Z * 1000;
            }
            else
            {
                support.RestraintConstantZ = -1;
            }
            //support.UserDefinedReferenceSystem


            SupportInf container = new SupportInf(ghPoints, support);

            DA.SetData(0, new GH_ObjectWrapper(container));
        }
 public RFSupportP(NodalSupport support) : this(support, null)
 {
 }