Esempio n. 1
0
 /// <summary>
 /// Creates the Delaunay triangulation of the input data.
 /// </summary>
 /// <typeparam name="TVertex">The type of the t vertex.</typeparam>
 /// <typeparam name="TFace">The type of the t face.</typeparam>
 /// <param name="data">The data.</param>
 /// <param name="PlaneDistanceTolerance">The plane distance tolerance (default is 1e-10). If too high, points
 /// will be missed. If too low, the algorithm may break. Only adjust if you notice problems.</param>
 /// <returns>ITriangulation&lt;TVertex, TFace&gt;.</returns>
 public static ITriangulation <TVertex, TFace> CreateDelaunay <TVertex, TFace>(IList <TVertex> data,
                                                                               double PlaneDistanceTolerance = Constants.DefaultPlaneDistanceTolerance)
     where TVertex : IVertex
     where TFace : TriangulationCell <TVertex, TFace>, new()
 {
     return(DelaunayTriangulation <TVertex, TFace> .Create(data, PlaneDistanceTolerance));
 }
Esempio n. 2
0
 /// <summary>
 /// Creates the Delaunay triangulation of the input data.
 /// </summary>
 /// <typeparam name="TVertex">The type of the t vertex.</typeparam>
 /// <param name="data">The data.</param>
 /// <param name="PlaneDistanceTolerance">The plane distance tolerance (default is 1e-10). If too high, points
 /// will be missed. If too low, the algorithm may break. Only adjust if you notice problems.</param>
 /// <returns>ITriangulation&lt;TVertex, DefaultTriangulationCell&lt;TVertex&gt;&gt;.</returns>
 public static ITriangulation <TVertex, DefaultTriangulationCell <TVertex> > CreateDelaunay <TVertex>(
     IList <TVertex> data,
     float PlaneDistanceTolerance = Constants.DefaultPlaneDistanceTolerance)
     where TVertex : IVertex
 {
     return(DelaunayTriangulation <TVertex, DefaultTriangulationCell <TVertex> > .Create(data, PlaneDistanceTolerance));
 }
Esempio n. 3
0
        /// <summary>
        /// Creates the Delaunay triangulation of the input data.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="config">If null, default TriangulationComputationConfig is used.</param>
        /// <returns></returns>
        public static ITriangulation <DefaultVertex, DefaultTriangulationCell <DefaultVertex> > CreateDelaunay(IList <double[]> data, TriangulationComputationConfig config = null)
        {
            var points = data.Select(p => new DefaultVertex {
                Position = p.ToArray()
            }).ToList();

            return(DelaunayTriangulation <DefaultVertex, DefaultTriangulationCell <DefaultVertex> > .Create(points, config));
        }
Esempio n. 4
0
        /// <summary>
        /// Creates the Delaunay triangulation of the input data.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public static ITriangulation <DefaultVertex, DefaultTriangulationCell <DefaultVertex> > CreateDelaunay(IEnumerable <double[]> data)
        {
            var points = data.Select(p => new DefaultVertex {
                PositionArray = p.ToArray()
            });

            return(DelaunayTriangulation <DefaultVertex, DefaultTriangulationCell <DefaultVertex> > .Create(points));
        }
Esempio n. 5
0
        /// <summary>
        /// Creates the Delaunay triangulation of the input data.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <param name="config">If null, default TriangulationComputationConfig is used.</param>
        /// <returns>ITriangulation&lt;DefaultVertex, DefaultTriangulationCell&lt;DefaultVertex&gt;&gt;.</returns>
        public static ITriangulation <DefaultVertex, DefaultTriangulationCell <DefaultVertex> > CreateDelaunay(
            IList <double[]> data)
        {
            var points = data.Select(p => new DefaultVertex {
                Position = p
            }).ToList();

            return(DelaunayTriangulation <DefaultVertex, DefaultTriangulationCell <DefaultVertex> > .Create(points));
        }
Esempio n. 6
0
        /// <summary>
        /// Creates the Delaunay triangulation of the input data.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <param name="PlaneDistanceTolerance">The plane distance tolerance (default is 1e-10). If too high, points
        /// will be missed. If too low, the algorithm may break. Only adjust if you notice problems.</param>
        /// <returns>ITriangulation&lt;DefaultVertex, DefaultTriangulationCell&lt;DefaultVertex&gt;&gt;.</returns>
        public static ITriangulation <DefaultVertex, DefaultTriangulationCell <DefaultVertex> > CreateDelaunay(
            IList <double[]> data,
            double PlaneDistanceTolerance = Constants.DefaultPlaneDistanceTolerance)
        {
            var points = data.Select(p => new DefaultVertex {
                Position = p
            }).ToList();

            return(DelaunayTriangulation <DefaultVertex, DefaultTriangulationCell <DefaultVertex> > .Create(points, PlaneDistanceTolerance));
        }
        public static ITriangulation <DefaultVertex, DefaultTriangulationCell <DefaultVertex> > CreateDelaunay(IList <double[]> data)
        {
            List <DefaultVertex> data2 = (from p in data
                                          select new DefaultVertex
            {
                Position = p
            }).ToList();

            return(DelaunayTriangulation <DefaultVertex, DefaultTriangulationCell <DefaultVertex> > .Create(data2));
        }
Esempio n. 8
0
        /// <summary>
        /// Creates the Delaunay triangulation of the input data.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public static ITriangulation <DefaultVertex, DefaultTriangulationCell <DefaultVertex> > CreateDelaunay(IEnumerable <float[]> data)
        {
            //DefaultVertex dv = new DefaultVertex();
            List <DefaultVertex> points = new List <DefaultVertex>();

            foreach (float[] d in data)
            {
                points.Add(new DefaultVertex(d));
            }
            //EDGAR TODO
            //var points = data.Select(p => new DefaultVertex { ToArray() = p.ToArray() });
            return(DelaunayTriangulation <DefaultVertex, DefaultTriangulationCell <DefaultVertex> > .Create(points));
        }
Esempio n. 9
0
        public static DelaunayTriangulation <TVertex, TCell> Create(IList <TVertex> data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }
            DelaunayTriangulation <TVertex, TCell> delaunayTriangulation;

            if (data.Count == 0)
            {
                delaunayTriangulation       = new DelaunayTriangulation <TVertex, TCell>();
                delaunayTriangulation.Cells = new TCell[0];
                return(delaunayTriangulation);
            }
            TCell[] delaunayTriangulation2 = ConvexHullAlgorithm.GetDelaunayTriangulation <TVertex, TCell>(data);
            delaunayTriangulation       = new DelaunayTriangulation <TVertex, TCell>();
            delaunayTriangulation.Cells = delaunayTriangulation2;
            return(delaunayTriangulation);
        }
Esempio n. 10
0
 /// <summary>
 /// Creates the Delaunay triangulation of the input data.
 /// </summary>
 /// <typeparam name="TVertex"></typeparam>
 /// <typeparam name="TFace"></typeparam>
 /// <param name="data"></param>
 /// <param name="config">If null, default TriangulationComputationConfig is used.</param>
 /// <returns></returns>
 public static ITriangulation <TVertex, TFace> CreateDelaunay <TVertex, TFace>(IList <TVertex> data, TriangulationComputationConfig config = null)
     where TVertex : IVertex
     where TFace : TriangulationCell <TVertex, TFace>, new()
 {
     return(DelaunayTriangulation <TVertex, TFace> .Create(data, config));
 }
Esempio n. 11
0
 /// <summary>
 /// Creates the Delaunay triangulation of the input data.
 /// </summary>
 /// <typeparam name="TVertex"></typeparam>
 /// <param name="data"></param>
 /// <param name="config">If null, default TriangulationComputationConfig is used.</param>
 /// <returns></returns>
 public static ITriangulation <TVertex, DefaultTriangulationCell <TVertex> > CreateDelaunay <TVertex>(IList <TVertex> data, TriangulationComputationConfig config = null)
     where TVertex : IVertex
 {
     return(DelaunayTriangulation <TVertex, DefaultTriangulationCell <TVertex> > .Create(data, config));
 }
Esempio n. 12
0
 /// <summary>
 /// Creates the Delaunay triangulation of the input data.
 /// </summary>
 /// <typeparam name="TVertex"></typeparam>
 /// <typeparam name="TFace"></typeparam>
 /// <param name="data"></param>
 /// <returns></returns>
 public static ITriangulation <TVertex, TFace> CreateDelaunay <TVertex, TFace>(IEnumerable <TVertex> data)
     where TVertex : IVector
     where TFace : TriangulationCell <TVertex, TFace>, new()
 {
     return(DelaunayTriangulation <TVertex, TFace> .Create(data));
 }
Esempio n. 13
0
 /// <summary>
 /// Creates the Delaunay triangulation of the input data.
 /// </summary>
 /// <typeparam name="TVertex"></typeparam>
 /// <param name="data"></param>
 /// <returns></returns>
 public static ITriangulation <TVertex, DefaultTriangulationCell <TVertex> > CreateDelaunay <TVertex>(IEnumerable <TVertex> data)
     where TVertex : IVector
 {
     return(DelaunayTriangulation <TVertex, DefaultTriangulationCell <TVertex> > .Create(data));
 }
Esempio n. 14
0
 /// <summary>
 /// Creates the Delaunay triangulation of the input data.
 /// </summary>
 /// <typeparam name="TVertex">The type of the t vertex.</typeparam>
 /// <param name="data">The data.</param>
 /// <param name="config">If null, default TriangulationComputationConfig is used.</param>
 /// <returns>ITriangulation&lt;TVertex, DefaultTriangulationCell&lt;TVertex&gt;&gt;.</returns>
 public static ITriangulation <TVertex, DefaultTriangulationCell <TVertex> > CreateDelaunay <TVertex>(
     IList <TVertex> data)
     where TVertex : IVertex
 {
     return(DelaunayTriangulation <TVertex, DefaultTriangulationCell <TVertex> > .Create(data));
 }