예제 #1
0
        internal virtual com.epl.geometry.Point _RandomizeExisting()
        {
            if (points.Count == 0)
            {
                return(_GenerateNewPoint());
            }
            double f   = random.NextDouble();
            int    num = (int)(f * points.Count);

            com.epl.geometry.Point pt = points[num];
            f = random.NextDouble();
            // if (f > 0.9)
            if (f > 2)
            {
                f = random.NextDouble();
                pt.SetX(pt.GetX() + (1 - 2 * f) * 2 * tolerance);
                f = random.NextDouble();
                pt.SetY(pt.GetY() + (1 - 2 * f) * 2 * tolerance);
                pt = _snapClip(pt, env);
            }
            return(pt);
        }