/// <summary>
        ///
        /// </summary>
        /// <param name="mesh"></param>
        /// <param name="target"></param>
        /// <param name="features"></param>
        /// <param name="tolerance"></param>
        public DynamicRemesher(HeMeshSim mesh, MeshFeature target, IEnumerable <IFeature> features, double tolerance = 1.0e-4)
        {
            _mesh   = mesh;
            _verts  = _mesh.Vertices;
            _hedges = _mesh.Halfedges;
            _faces  = _mesh.Faces;

            // triangulate all faces starting with the shortest diagonal
            _mesh.TriangulateFaces(FaceTriangulators.Strip.CreateFromMin(mesh, he => he.Start.Position.SquareDistanceTo(he.NextInFace.End.Position)));

            // initialize features
            _target = target;
            InitFeatures(features, tolerance);

            _settings  = new DynamicRemesherSettings();
            _stepCount = 0;
        }
        /// <summary>
        ///
        /// </summary>
        /// <typeparam name="TV"></typeparam>
        /// <typeparam name="TE"></typeparam>
        /// <typeparam name="TF"></typeparam>
        /// <param name="mesh"></param>
        /// <param name="target"></param>
        /// <param name="features"></param>
        /// <param name="tolerance"></param>
        /// <returns></returns>
        public static DynamicRemesher Create <TV, TE, TF>(HeMeshBase <TV, TE, TF> mesh, MeshFeature target, IEnumerable <IFeature> features, double tolerance = 1.0e-4)
            where TV : HeVertex <TV, TE, TF>, IVertex3d
            where TE : Halfedge <TV, TE, TF>
            where TF : HeFace <TV, TE, TF>
        {
            var copy = HeMeshSim.Factory.CreateCopy(mesh, (v0, v1) => v0.Position = v1.Position, delegate { }, delegate { });

            return(new DynamicRemesher(copy, target, features, tolerance));
        }