コード例 #1
0
        private IEnumerable <PolygonChanged> OutgoingForPoint(int pointIndex)
        {
            var polygon    = CurrentPicture.Polygons[0];
            var unfiltered = discreteSpiralPointMutation.SpiralPoints(polygon.Points[pointIndex]).Select(
                point => ReplacePoint(point, pointIndex));
            var filtered = unfiltered.Where(x => !x.NewPolygon.IsSelfIntersecting());

            return(filtered);
        }
コード例 #2
0
 IEnumerable <PolygonChanged> MutatePoint(int pointIndex)
 {
     return(changeSpiralPointMutation.SpiralPoints(Polygon.Points[pointIndex]).Select(point => ReplacePoint(point, pointIndex)));
 }
コード例 #3
0
        IEnumerable <PolygonChanged> InsertPoint(int pointIndex)
        {
            var halfWayPoint = (Polygon.Points[pointIndex] + Polygon.Points[(pointIndex + 1) % Polygon.Points.Count]) / 2;

            return(insertSpiralPointMutation.SpiralPoints(halfWayPoint).Select(point => InsertPoint(point, pointIndex)));
        }
コード例 #4
0
 private IEnumerable <PointMutation> MutatePoint(int pointIndex)
 {
     return(discreteSpiralPointMutation.SpiralPoints(Polygon.Points[pointIndex]).Select(point => (PointMutation) new ChangedPoint(pointIndex, point)));
 }