Esempio n. 1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            double orthoAlpha = 0;
            double orthoRatio = 1;

            if (!DA.GetData(0, ref orthoAlpha))
            {
                // pass
            }
            if (!DA.GetData(1, ref orthoRatio))
            {
                // pass
            }

            //
            FemDesign.Shells.ShellOrthotropy obj = new FemDesign.Shells.ShellOrthotropy(orthoAlpha, orthoRatio);

            // return
            DA.SetData(0, obj);
        }
Esempio n. 2
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            Brep surface = null;

            if (!DA.GetData(0, ref surface))
            {
                return;
            }

            double thickness = 0;

            if (!DA.GetData(1, ref thickness))
            {
                return;
            }

            FemDesign.Materials.Material material = null;
            if (!DA.GetData(2, ref material))
            {
                return;
            }

            FemDesign.Shells.ShellEccentricity eccentricity = FemDesign.Shells.ShellEccentricity.GetDefault();
            if (!DA.GetData(3, ref eccentricity))
            {
                // pass
            }

            FemDesign.Shells.ShellOrthotropy orthotropy = FemDesign.Shells.ShellOrthotropy.GetDefault();
            if (!DA.GetData(4, ref orthotropy))
            {
                // pass
            }

            FemDesign.Shells.EdgeConnection edgeConnection = FemDesign.Shells.EdgeConnection.GetRigid();
            if (!DA.GetData(5, ref edgeConnection))
            {
                // pass
            }

            Rhino.Geometry.Vector3d x = Vector3d.Zero;
            if (!DA.GetData(6, ref x))
            {
                // pass
            }

            Rhino.Geometry.Vector3d z = Vector3d.Zero;
            if (!DA.GetData(7, ref z))
            {
                // pass
            }

            string identifier = "P";

            if (!DA.GetData(8, ref identifier))
            {
                // pass
            }

            if (surface == null || material == null || eccentricity == null || orthotropy == null || edgeConnection == null || identifier == null)
            {
                return;
            }

            //
            FemDesign.Geometry.Region region = surface.FromRhino();

            //
            List <FemDesign.Shells.Thickness> thicknessObj = new List <FemDesign.Shells.Thickness>();

            thicknessObj.Add(new FemDesign.Shells.Thickness(region.CoordinateSystem.Origin, thickness));

            //
            FemDesign.Shells.Slab obj = FemDesign.Shells.Slab.Plate(identifier, material, region, edgeConnection, eccentricity, orthotropy, thicknessObj);

            // set local x-axis
            if (!x.Equals(Vector3d.Zero))
            {
                obj.SlabPart.LocalX = x.FromRhino();
            }

            // set local z-axis
            if (!z.Equals(Vector3d.Zero))
            {
                obj.SlabPart.LocalZ = z.FromRhino();
            }

            // return
            DA.SetData(0, obj);
        }
Esempio n. 3
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input

            Brep surface = null;

            if (!DA.GetData(0, ref surface))
            {
                return;
            }

            List <FemDesign.Shells.Thickness> thickness = new List <FemDesign.Shells.Thickness>();

            if (!DA.GetDataList(1, thickness))
            {
                return;
            }

            FemDesign.Materials.Material material = null;
            if (!DA.GetData(2, ref material))
            {
                return;
            }

            FemDesign.Shells.ShellEccentricity eccentricity = FemDesign.Shells.ShellEccentricity.GetDefault();
            if (!DA.GetData(3, ref eccentricity))
            {
                // pass
            }

            FemDesign.Shells.ShellOrthotropy orthotropy = FemDesign.Shells.ShellOrthotropy.GetDefault();
            if (!DA.GetData(4, ref orthotropy))
            {
                // pass
            }

            FemDesign.Shells.EdgeConnection edgeConnection = FemDesign.Shells.EdgeConnection.GetRigid();
            if (!DA.GetData(5, ref edgeConnection))
            {
                // pass
            }

            Rhino.Geometry.Vector3d x = Vector3d.Zero;
            if (!DA.GetData(6, ref x))
            {
                // pass
            }

            Rhino.Geometry.Vector3d z = Vector3d.Zero;
            if (!DA.GetData(7, ref z))
            {
                // pass
            }

            string identifier = "W";

            if (!DA.GetData(8, ref identifier))
            {
                // pass
            }
            if (surface == null || thickness == null || material == null || eccentricity == null || orthotropy == null || edgeConnection == null)
            {
                return;
            }
            if (thickness.Count != 2)
            {
                throw new System.ArgumentException("Thickness must contain exactly 2 items.");
            }

            // convert geometry
            FemDesign.Geometry.Region region = surface.FromRhino();

            //
            FemDesign.Shells.Slab obj = FemDesign.Shells.Slab.Wall(identifier, material, region, edgeConnection, eccentricity, orthotropy, thickness);

            // set local x-axis
            if (!x.Equals(Vector3d.Zero))
            {
                obj.SlabPart.LocalX = x.FromRhino();
            }

            // set local z-axis
            if (!z.Equals(Vector3d.Zero))
            {
                obj.SlabPart.LocalZ = z.FromRhino();
            }

            // return
            DA.SetData(0, obj);
        }