bool fill_planar() { Vector3d n = Vector3d.Zero, c = Vector3d.Zero; int NE = FillLoop.EdgeCount; for (int k = 0; k < NE; ++k) { int eid = FillLoop.Edges[k]; n += Mesh.GetTriNormal(Mesh.GetEdgeT(eid).a); c += Mesh.GetEdgePoint(eid, 0.5); } n.Normalize(); c /= (double)NE; var filler = new PlanarHoleFiller(Mesh); filler.FillTargetEdgeLen = TargetEdgeLength; filler.AddFillLoop(FillLoop); filler.SetPlane(c, n); bool bOK = filler.Fill(); return(bOK); }