Ejemplo n.º 1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get data
            Brep brep = null;

            FemDesign.Reinforcement.Straight straight = null;
            FemDesign.Reinforcement.Wire     wire     = null;
            if (!DA.GetData(0, ref brep))
            {
                return;
            }
            if (!DA.GetData(1, ref straight))
            {
                return;
            }
            if (!DA.GetData(2, ref wire))
            {
                return;
            }
            if (brep == null || straight == null || wire == null)
            {
                return;
            }

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

            //
            FemDesign.Reinforcement.SurfaceReinforcement obj = FemDesign.Reinforcement.SurfaceReinforcement.DefineStraightSurfaceReinforcement(region, straight, wire);

            // return
            DA.SetData(0, obj);
        }
Ejemplo n.º 2
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get data
            Brep brep = null;
            List <FemDesign.Bars.Bar>    bars  = new List <FemDesign.Bars.Bar>();
            List <FemDesign.Shells.Slab> slabs = new List <FemDesign.Shells.Slab>();
            Vector3d vector     = Vector3d.XAxis;
            string   identifier = "CO";

            if (!DA.GetData(0, ref brep))
            {
                return;
            }
            if (!DA.GetDataList(1, bars))
            {
                // pass
            }
            if (!DA.GetDataList(2, slabs))
            {
                // pass
            }
            if (!DA.GetData(3, ref vector))
            {
                // pass
            }
            if (!DA.GetData(4, ref identifier))
            {
                // pass
            }
            if (brep == null || bars == null || slabs == null || vector == null || identifier == null)
            {
                return;
            }

            // create list of supporting structures
            List <object> structures = new List <object>();

            foreach (FemDesign.Bars.Bar bar in bars)
            {
                structures.Add(bar);
            }
            foreach (FemDesign.Shells.Slab slab in slabs)
            {
                structures.Add(slab);
            }

            // convert geometry
            FemDesign.Geometry.Region     region     = brep.FromRhino();
            FemDesign.Geometry.FdVector3d fdVector3d = vector.FromRhino().Normalize();

            //
            FemDesign.Cover obj = FemDesign.Cover.OneWayCover(region, structures, fdVector3d, identifier);

            // return
            DA.SetData(0, obj);
        }
Ejemplo n.º 3
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get data
            Brep     surface = null;
            Vector3d direction = Vector3d.Zero;
            LoadCase loadCase = null;
            double   z0 = 0, q0 = 0, qh = 0;
            string   comment = null;

            if (!DA.GetData(0, ref surface))
            {
                return;
            }
            if (!DA.GetData(1, ref direction))
            {
                return;
            }
            if (!DA.GetData(2, ref loadCase))
            {
                return;
            }
            if (!DA.GetData(3, ref z0))
            {
                return;
            }
            if (!DA.GetData(4, ref q0))
            {
                return;
            }
            if (!DA.GetData(5, ref qh))
            {
                return;
            }
            if (!DA.GetData(6, ref comment))
            {
                // pass
            }
            if (surface == null || loadCase == null)
            {
                return;
            }

            // transform geometry
            FemDesign.Geometry.Region     region        = surface.FromRhino();
            FemDesign.Geometry.FdVector3d loadDirection = direction.FromRhino().Normalize();

            PressureLoad obj = new PressureLoad(region, loadDirection, z0, q0, qh, loadCase, comment, false, ForceLoadType.Force);

            // return
            DA.SetData(0, obj);
        }
Ejemplo n.º 4
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get data
            Brep     surface   = null;
            Vector3d direction = Vector3d.Zero;
            List <FemDesign.Loads.LoadLocationValue> loads = new List <FemDesign.Loads.LoadLocationValue>();

            FemDesign.Loads.LoadCase loadCase = null;
            string comment = null;

            if (!DA.GetData(0, ref surface))
            {
                return;
            }
            if (!DA.GetData(1, ref direction))
            {
                return;
            }
            if (!DA.GetDataList(2, loads))
            {
                return;
            }
            if (!DA.GetData(3, ref loadCase))
            {
                return;
            }
            if (!DA.GetData(4, ref comment))
            {
                // pass
            }
            if (surface == null || loads == null || loadCase == null)
            {
                return;
            }
            if (loads.Count != 3)
            {
                throw new System.ArgumentException("Load must contain exactly 3 items");
            }

            // transform geometry
            FemDesign.Geometry.Region     region   = surface.FromRhino();
            FemDesign.Geometry.FdVector3d fdVector = direction.FromRhino().Normalize();

            //
            FemDesign.Loads.SurfaceLoad obj = FemDesign.Loads.SurfaceLoad.Variable(region, fdVector, loads, loadCase, false, comment);

            // return
            DA.SetData(0, obj);
        }
Ejemplo n.º 5
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Brep     surface   = null;
            Vector3d direction = Vector3d.Zero;
            List <FemDesign.Loads.LoadLocationValue> loads = new List <FemDesign.Loads.LoadLocationValue>();

            FemDesign.Loads.LoadCase loadCase = null;
            bool   loadProjection             = false;
            string comment = "";

            if (!DA.GetData("Surface", ref surface))
            {
                return;
            }
            if (!DA.GetData("Direction", ref direction))
            {
                return;
            }
            if (!DA.GetDataList("LoadLocationValue", loads))
            {
                return;
            }
            DA.GetData("LoadProjection", ref loadProjection);
            if (!DA.GetData("LoadCase", ref loadCase))
            {
                return;
            }
            DA.GetData("Comment", ref comment);

            if (surface == null || loads == null || loadCase == null)
            {
                return;
            }
            if (loads.Count != 3)
            {
                throw new System.ArgumentException("Load must contain exactly 3 items");
            }

            // Convert geometry
            FemDesign.Geometry.Region     region   = surface.FromRhino();
            FemDesign.Geometry.FdVector3d fdVector = direction.FromRhino().Normalize();

            FemDesign.Loads.SurfaceLoad obj = FemDesign.Loads.SurfaceLoad.Variable(region, fdVector, loads, loadCase, loadProjection, comment);

            DA.SetData("SurfaceLoad", obj);
        }
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get data
            Brep     surface = null;
            Vector3d force   = Vector3d.Zero;

            FemDesign.Loads.LoadCase loadCase = null;
            string comment = "";

            if (!DA.GetData(0, ref surface))
            {
                return;
            }
            if (!DA.GetData(1, ref force))
            {
                return;
            }
            if (!DA.GetData(2, ref loadCase))
            {
                return;
            }
            if (!DA.GetData(3, ref comment))
            {
                // pass
            }
            if (surface == null || force == null || loadCase == null)
            {
                return;
            }

            // transform geometry
            FemDesign.Geometry.Region     region = surface.FromRhino();
            FemDesign.Geometry.FdVector3d _force = force.FromRhino();

            //
            FemDesign.Loads.SurfaceLoad obj = FemDesign.Loads.SurfaceLoad.Uniform(region, _force, loadCase, false, comment);

            // return
            DA.SetData(0, obj);
        }
Ejemplo n.º 7
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Brep     surface = null;
            Vector3d force   = Vector3d.Zero;

            FemDesign.Loads.LoadCase loadCase = null;
            bool   loadProjection             = false;
            string comment = "";

            if (!DA.GetData("Surface", ref surface))
            {
                return;
            }
            if (!DA.GetData("Force", ref force))
            {
                return;
            }
            DA.GetData("LoadProjection", ref loadProjection);
            if (!DA.GetData("LoadCase", ref loadCase))
            {
                return;
            }
            DA.GetData("Comment", ref comment);

            if (surface == null || force == null || loadCase == null)
            {
                return;
            }

            // Convert geometry
            FemDesign.Geometry.Region     region = surface.FromRhino();
            FemDesign.Geometry.FdVector3d _force = force.FromRhino();

            FemDesign.Loads.SurfaceLoad obj = FemDesign.Loads.SurfaceLoad.Uniform(region, _force, loadCase, loadProjection, comment);

            DA.SetData("SurfaceLoad", obj);
        }
Ejemplo n.º 8
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);
        }
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            Brep surface = null;

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

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

            FemDesign.Sections.Section section = null;
            if (!DA.GetData(2, ref section))
            {
                return;
            }

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

            double orthoRatio = 1;

            if (!DA.GetData(4, ref orthoRatio))
            {
                // pass
            }

            FemDesign.Shells.EdgeConnection edgeConnection = FemDesign.Shells.EdgeConnection.GetHinged();
            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
            }

            double meshSize = 0;

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

            string identifier = "PP";

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

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


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

            //
            FemDesign.Shells.Panel obj = FemDesign.Shells.Panel.DefaultContreteContinuous(region, edgeConnection, material, section, identifier, orthoRatio, eccentricity);

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

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

            // set uniform average mesh size
            obj.UniformAvgMeshSize = meshSize;

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