Example #1
0
 /// <summary>
 /// Create the voronoi mesh.
 /// </summary>
 /// <typeparam name="TVertex"></typeparam>
 /// <typeparam name="TCell"></typeparam>
 /// <typeparam name="TEdge"></typeparam>
 /// <param name="data"></param>
 /// <param name="config">If null, default TriangulationComputationConfig is used.</param>
 /// <returns></returns>
 public static VoronoiMesh <TVertex, TCell, TEdge> Create <TVertex, TCell, TEdge>(IList <TVertex> data, TriangulationComputationConfig config = null)
     where TCell : TriangulationCell <TVertex, TCell>, new()
     where TVertex : IVertex
     where TEdge : VoronoiEdge <TVertex, TCell>, new()
 {
     return(VoronoiMesh <TVertex, TCell, TEdge> .Create(data, config));
 }
Example #2
0
        Create(IList <double[]> data, TriangulationComputationConfig config = null)
        {
            var points = data.Select(p => new DefaultVertex {
                Position = p.ToArray()
            }).ToList();

            return(VoronoiMesh <DefaultVertex, DefaultTriangulationCell <DefaultVertex>, VoronoiEdge <DefaultVertex, DefaultTriangulationCell <DefaultVertex> > > .Create(points, config));
        }
Example #3
0
 /// <summary>
 /// Create the voronoi mesh.
 /// </summary>
 /// <typeparam name="TVertex"></typeparam>
 /// <param name="data"></param>
 /// <param name="config">If null, default TriangulationComputationConfig is used.</param>
 /// <returns></returns>
 public static VoronoiMesh <TVertex, DefaultTriangulationCell <TVertex>, VoronoiEdge <TVertex, DefaultTriangulationCell <TVertex> > > Create <TVertex>(IList <TVertex> data, TriangulationComputationConfig config = null)
     where TVertex : IVertex
 {
     return(VoronoiMesh <TVertex, DefaultTriangulationCell <TVertex>, VoronoiEdge <TVertex, DefaultTriangulationCell <TVertex> > > .Create(data, config));
 }