new public void Init() { origin = new DnaPoint(); origin.Init(tool); Brush = new DnaBrush(); Brush.Init(tool); rx = ry = tool.GetRandomNumber(0.0, 5.0); rotation = 0; }
override public void Init() { origin = new DnaPoint(); origin.Init(tool); Brush = new DnaBrush(); Brush.Init(tool); rx = ry = tool.GetRandomNumber(0, Settings.ActiveMaxCircleRadius); rotation = 0; }
public virtual void Init() { origin = new DnaPoint(); origin.Init(tool); Brush = new DnaBrush(); Brush.Init(tool); rx = tool.GetRandomNumber(0, Settings.ActiveMaxCircleRadius); ry = tool.GetRandomNumber(0, Settings.ActiveMaxCircleRadius); rotation = tool.GetRandomNumber(-99.0, 99.0); }
public static DnaPolygon GetRandom(int maxX, int maxY) { var points = new List <DnaPoint>(); //int count = Tools.GetRandomNumber(3, 3); var origin = DnaPoint.GetRandom(maxX, maxY); for (int i = 0; i < Settings.ActivePointsPerPolygonMin; i++) { int clampedX = MathUtils.Clamp(origin.X + Tools.GetRandomNumber(-3, 3), 0, maxX); int clampedY = MathUtils.Clamp(origin.Y + Tools.GetRandomNumber(-3, 3), 0, maxY); var clampedPoint = new DnaPoint(clampedX, clampedY); points.Add(clampedPoint); } var brush = DnaBrush.GetRandom(); return(new DnaPolygon(points, brush)); }
public static DnaPolygon GetRandom(int maxX, int maxY) { var points = new List<DnaPoint>(); //int count = Tools.GetRandomNumber(3, 3); var origin = DnaPoint.GetRandom(maxX, maxY); for (int i = 0; i < Settings.ActivePointsPerPolygonMin; i++) { int clampedX = MathUtils.Clamp(origin.X + Tools.GetRandomNumber(-3, 3), 0, maxX); int clampedY = MathUtils.Clamp(origin.Y + Tools.GetRandomNumber(-3, 3), 0, maxY); var clampedPoint = new DnaPoint(clampedX, clampedY); points.Add(clampedPoint); } var brush = DnaBrush.GetRandom(); return new DnaPolygon(points, brush); }
public void Init() { Points = new List <DnaPoint>(); //int count = Tools.GetRandomNumber(3, 3); var origin = new DnaPoint(); origin.Init(); for (int i = 0; i < Settings.ActivePointsPerPolygonMin; i++) { var point = new DnaPoint(); point.X = Math.Min(Math.Max(0, origin.X + Tools.GetRandomNumber(-3, 3)), Tools.MaxWidth); point.Y = Math.Min(Math.Max(0, origin.Y + Tools.GetRandomNumber(-3, 3)), Tools.MaxHeight); Points.Add(point); } Brush = new DnaBrush(); Brush.Init(); }
private void AddPoint(DnaDrawing drawing) { if (Points.Count < Settings.ActivePointsPerPolygonMax) { if (drawing.PointCount < Settings.ActivePointsMax) { var newPoint = new DnaPoint(); int index = Tools.GetRandomNumber(1, Points.Count - 1); DnaPoint prev = Points[index - 1]; DnaPoint next = Points[index]; newPoint.X = (prev.X + next.X) / 2; newPoint.Y = (prev.Y + next.Y) / 2; Points.Insert(index, newPoint); drawing.SetDirty(); } } }