protected override void SolveInstance(IGH_DataAccess DA)
        {
            FemDesign.Shells.Panel panel = null;
            if (!DA.GetData(0, ref panel))
            {
                return;
            }

            FemDesign.Shells.EdgeConnection shellEdgeConnection = null;
            if (!DA.GetData(1, ref shellEdgeConnection))
            {
                return;
            }

            List <int> indices = new List <int>();

            if (!DA.GetDataList(2, indices))
            {
                return;
            }
            if (panel == null)
            {
                return;
            }

            // clone
            FemDesign.Shells.Panel panelClone = panel.DeepClone();

            // set edge connections
            panelClone.SetExternalEdgeConnectionsForContinuousAnalyticalModel(shellEdgeConnection, indices);

            //
            DA.SetData(0, panelClone);
        }
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // get input
            FemDesign.Shells.Panel panel = null;
            if (!DA.GetData(0, ref panel))
            {
                return;
            }
            if (panel == null)
            {
                return;
            }

            if (panel.InternalPanels.IntPanels.Count != 1)
            {
                throw new System.ArgumentException("Panel has more than 1 internal panel. Panel analytical model is not of type continuous.");
            }

            // Get Material (concrete/steel material) or TimberPanelData (timber material)
            Materials.IMaterial material = null;
            if (panel.Material != null)
            {
                material = panel.Material;
            }
            else if (panel.TimberPanelData != null)
            {
                material = panel.TimberPanelData;
            }

            DA.SetData("Guid", panel.Guid);
            DA.SetData("ExtSurface", panel.InternalPanels.IntPanels[0].Region.ToRhinoBrep());
            DA.SetData("Material", material);
            DA.SetData("Section", panel.Section);
            DA.SetDataList("ExtEdgeCurves", panel.InternalPanels.IntPanels[0].Region.ToRhinoCurves());
            DA.SetDataList("ExtEdgeConnections", panel.InternalPanels.IntPanels[0].Region.GetEdgeConnections());
            DA.SetData("LocalX", panel.LocalX.ToRhino());
            DA.SetData("LocalY", panel.LocalY.ToRhino());
            DA.SetData("Identifier", panel.Identifier);
        }
示例#3
0
        public static Dictionary <string, object> PanelContinuousAnalyticalModelDeconstruct(FemDesign.Shells.Panel panel)
        {
            if (panel.InternalPanels.IntPanels.Count != 1)
            {
                throw new System.ArgumentException("Panel has more than 1 internal panel. Panel analytical model is not of type continuous.");
            }

            return(new Dictionary <string, object>
            {
                { "Guid", panel.Guid },
                { "ExtSurface", panel.InternalPanels.IntPanels[0].Region.ToDynamoSurface() },
                { "Material", panel.Material },
                { "Section", panel.Section },
                { "ExtEdgeCurves", panel.InternalPanels.IntPanels[0].Region.ToDynamoCurves() },
                { "ExtEdgeConnections", panel.InternalPanels.IntPanels[0].Region.GetEdgeConnections() },
                { "LocalX", panel.LocalX.ToDynamo() },
                { "LocalY", panel.LocalY.ToDynamo() },
                { "Identifier", panel.Identifier }
            });
        }
示例#4
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);
        }