public ShapeCollection Create(ClusterCollection clusterData)
{
var result = new ShapeCollection();
foreach (var cluster in clusterData.Clusters)
{
var convexHull = new GrahamScan(cluster.Points).FindHull();
var map = CreateMap(cluster);
var contour = CreateContour(map, cluster);
if (contour.Count >= settings.MinimalPointsInContour)
{
result.Shapes.Add(new Shape(cluster.Center, cluster.Volume, contour, convexHull, cluster.Points));
}
}
return result;
}