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); }
IEnumerable <PolygonChanged> MutatePoint(int pointIndex) { return(changeSpiralPointMutation.SpiralPoints(Polygon.Points[pointIndex]).Select(point => ReplacePoint(point, pointIndex))); }
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))); }
private IEnumerable <PointMutation> MutatePoint(int pointIndex) { return(discreteSpiralPointMutation.SpiralPoints(Polygon.Points[pointIndex]).Select(point => (PointMutation) new ChangedPoint(pointIndex, point))); }