Exemple #1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            this.Message = type.ToString();

            DMesh3_goo goo  = null;
            double     eLen = 1;

            DA.GetData(0, ref goo);
            DA.GetData(1, ref eLen);

            DMesh3 msh = new DMesh3(goo.Value);

            DMesh3            outMesh = msh;
            MeshBoundaryLoops loops   = new MeshBoundaryLoops(outMesh, true);

            var lps = loops.Loops;

            bool hasLoops = (lps.Count > 0);
            int  iter     = 0;

            while (hasLoops)
            {
                EdgeLoop loop = lps[0];

                switch (type)
                {
                case HoleFillerType.Planar:
                    outMesh = HoleFillMethods.PlanarFill(outMesh, loop, eLen);
                    break;

                case HoleFillerType.Smooth:
                    outMesh = HoleFillMethods.SmoothFill(outMesh, loop, eLen);
                    break;

                case HoleFillerType.Minimal:
                    outMesh = HoleFillMethods.MinimalFill(outMesh, loop, eLen);
                    break;

                default:
                    outMesh = HoleFillMethods.PlanarFill(outMesh, loop, eLen);
                    break;
                }

                loops = new MeshBoundaryLoops(outMesh, true);
                lps   = loops.Loops;

                hasLoops = (lps.Count > 0);

                iter++;
                if (iter > 500)
                {
                    break;
                }
            }

            this.Message += "\n" + iter.ToString() + " holes filled.";

            DA.SetData(0, outMesh);
        }
Exemple #2
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            this.Message = Type.ToString();

            DMesh3_goo   goo      = null;
            EdgeLoop_goo loop_goo = null;
            double       eLen     = 1;

            DA.GetData(0, ref goo);
            DA.GetData(1, ref loop_goo);
            DA.GetData(2, ref eLen);

            DMesh3   msh  = new DMesh3(goo.Value);
            EdgeLoop loop = new EdgeLoop(loop_goo.Value);

            DMesh3 outMesh;

            switch (Type)
            {
            case HoleFillerType.Planar:
                outMesh = HoleFillMethods.PlanarFill(msh, loop, eLen);
                break;

            case HoleFillerType.Smooth:
                outMesh = HoleFillMethods.SmoothFill(msh, loop, eLen);
                break;

            case HoleFillerType.Minimal:
                outMesh = HoleFillMethods.MinimalFill(msh, loop, eLen);
                break;

            default:
                outMesh = HoleFillMethods.PlanarFill(msh, loop, eLen);
                break;
            }

            DA.SetData(0, outMesh);
        }