protected override void SolveInstance(IGH_DataAccess DA)
        {
            MeshProps meshProps0 = DA.Fetch <MeshProps>("MeshProp0");

            NGonsCore.Nexorades.Nexors nexors0 = DA.Fetch <NGonsCore.Nexorades.Nexors>("Nexors0");

            MeshProps meshProps1 = DA.Fetch <MeshProps>("MeshProp1");

            NGonsCore.Nexorades.Nexors nexors1 = DA.Fetch <NGonsCore.Nexorades.Nexors>("Nexors1");

            try
            {
                DA.SetDataTree(0, nexors0.Beams2(meshProps0));
                DA.SetDataTree(1, nexors0.Panels(meshProps0));
                nexors0.RoundBeams(meshProps0, 0.06);
                DA.SetDataTree(2, nexors0.GetNexorPipesBreps());
                DA.SetDataTree(3, nexors0.Cuts());
                DA.SetDataTree(4, nexors0.GetCNC_Cuts());


                DA.SetDataTree(5, nexors1.Beams2(meshProps1));
                DA.SetDataTree(6, nexors1.Panels(meshProps1));
                nexors1.RoundBeams(meshProps1, 0.06);
                DA.SetDataTree(7, nexors1.GetNexorPipesBreps());
                DA.SetDataTree(8, nexors1.Cuts());
                DA.SetDataTree(9, nexors1.GetCNC_Cuts());

                DA.SetDataTree(10, nexors0.GetDowels(0.03, 10));
                DA.SetDataTree(11, nexors1.GetDowels(0.03, 10));
            }
            catch (Exception e)
            {
                Rhino.RhinoApp.WriteLine(e.ToString());
            }
        }
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            MeshProps meshProps = DA.Fetch <MeshProps>("MeshProp");
            //GH_Structure<GH_Number> D = DA.FetchTree<GH_Number>("Dist");
            List <double> D = DA.FetchList <double>("Dist");

            try
            {
                double     firstDist = (D.Count > 0) ? D[0] : 0.01;
                double[][] DArray    = new double[][] { new double[1] {
                                                            D[0]
                                                        } };


                if (D.Count > 0)
                {
                    DArray = new double[meshProps.FEFlatten.Length][];
                    for (int i = 0; i < meshProps.FEFlatten.Length; i++)
                    {
                        DArray[i] = new double[meshProps.FEFlatten[i].Length];
                    }

                    for (int i = 0; i < meshProps._FlattenFE.Count; i++)
                    {
                        DArray[meshProps._FlattenFE[i][0]][meshProps._FlattenFE[i][1]] = D[i % D.Count];
                    }
                }


                //Compute translation
                //Create Nexors
                NGonsCore.Nexorades.Nexors nexors = new NGonsCore.Nexorades.Nexors();
                for (int i = 0; i < meshProps.M._countF(); i++)
                {
                    for (int j = 0; j < meshProps.M._countE(i); j++)
                    {
                        nexors.Add(meshProps.EFLines[i][j], i, j);
                        nexors[i, j].translation = DArray[i][j];
                    }
                }



                Line[][] translatedLines = meshProps.NexorTranslateLines(ref nexors, DArray);



                //Output
                DA.SetDataTree(0, nexors.GetNexorLines());
                DA.SetDataTree(1, nexors.GetNexorEccentricities());
                DA.SetData(2, nexors);
                DA.SetData(3, meshProps);
                DA.SetDataTree(4, nexors.GetNexorLines(-1));
            }
            catch (Exception e)
            {
                Rhino.RhinoApp.WriteLine(e.ToString());
            }
        }
Beispiel #3
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Mesh m = new Mesh();

            DA.GetData(0, ref m);

            double dist = DA.Fetch <double>("Offset");
            bool   flip = DA.Fetch <bool>("Flip");

            if (dist != 0)
            {
                m = m.FaceFaceOffset(dist);
                //Rhino.RhinoDoc.ActiveDoc.Objects.AddMesh(m);
            }

            Mesh M = NGonsCore.MeshCreate.MeshFromPolylines(m.GetFacePolylinesArray(), 0.01);

            if (flip)
            {
                M.Flip(true, true, true);
            }
            DA.SetData(4, M);

            try
            {
                MeshProps mp = M._Planes();



                DA.SetData(0, mp);
                DA.SetDataTree(1, GrasshopperUtil.IE(mp.fPl, -1));
                DA.SetDataTree(2, GrasshopperUtil.IE2(mp.fePl));
                // DA.SetDataTree(3, GrasshopperUtil.IE2(mp.fePl90));
                DA.SetDataTree(3, GrasshopperUtil.IE(mp.ePl));
                //DA.SetDataTree(5, GrasshopperUtil.IE(mp.ePl90));
            }
            catch (Exception e)
            {
                Rhino.RhinoApp.WriteLine(e.ToString());
            }
        }