Exemple #1
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);
        }
 public static Dictionary <string, object> CoverDeconstruct(FemDesign.Cover cover)
 {
     return(new Dictionary <string, object>
     {
         { "Guid", cover.Guid },
         { "Id", cover.Identifier },
         { "Surface", cover.GetDynamoSurface() },
         { "Contours", cover.GetDynamoCurves() }
     });
 }
Exemple #3
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            FemDesign.Cover cover = null;
            if (!DA.GetData(0, ref cover))
            {
                return;
            }
            if (cover == null)
            {
                return;
            }

            // return

            DA.SetData(0, cover.Guid);
            DA.SetData(1, cover.Identifier);
            DA.SetData(2, cover.GetRhinoSurface());
            DA.SetDataList(3, cover.GetRhinoCurves());
        }