Exemplo n.º 1
0
        public AddTrianglesMeshChange fill_smooth(DMesh3 mesh, EdgeLoop loop)
        {
            AddTrianglesMeshChange addChange = null;
            SmoothedHoleFill       filler    = new SmoothedHoleFill(mesh, loop);

            filler.ConstrainToHoleInterior = true;
            if (this.AutoTargetEdgeLength)
            {
                double mine, maxe, avge;
                MeshQueries.EdgeLengthStatsFromEdges(mesh, loop.Edges, out mine, out maxe, out avge);
                filler.TargetEdgeLength = avge;
            }
            else
            {
                filler.TargetEdgeLength = this.TargetEdgeLength;
            }
            filler.SmoothSolveIterations = this.SmoothOptimizeRounds;

            bool fill_ok = filler.Apply();

            if (fill_ok)
            {
                addChange = new AddTrianglesMeshChange();
                addChange.InitializeFromExisting(mesh,
                                                 filler.FillVertices, filler.FillTriangles);
            }
            return(addChange);
        }
Exemplo n.º 2
0
        bool fill_smooth()
        {
            var fill = new SmoothedHoleFill(Mesh, FillLoop);

            fill.TargetEdgeLength        = TargetEdgeLength;
            fill.SmoothAlpha             = 1.0f;
            fill.ConstrainToHoleInterior = true;
            //fill.SmoothSolveIterations = 3;   // do this if we have a complicated hole - should be able to tell by normal histogram...
            return(fill.Apply());
        }