Ejemplo 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));
 }
Ejemplo 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));
 }
Ejemplo 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));
        }
Ejemplo 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));
        }
Ejemplo 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));
        }
Ejemplo 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));
        }
Ejemplo 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));
        }
Ejemplo n.º 9
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));
 }
Ejemplo n.º 10
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));
 }
Ejemplo n.º 11
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));
 }
Ejemplo n.º 12
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));
 }
Ejemplo n.º 13
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));
 }