// vrati polygon ktery je vycisten od
        // po sobe jdoucich shodnych bodu
        // a bodu ktere lezi na jende primce
        public static List <Point> PolygonPure(IPolygonReader poly, bool closed, double limit)
        {
            if (poly == null)
            {
                throw (new ArgumentNullException("PolygonPure(poly,..)"));
            }
            Point[]    pt     = new BoxArrayPoint(poly).Value;
            List <int> retInx = new List <int>(poly.Length);

            f_PolygonPure(pt, closed, limit, ref retInx);
            List <Point> ret = new List <Point>(retInx.Count);

            foreach (int i in retInx)
            {
                ret.Add(pt[i]);
            }
            return(ret);
        }
        public static List <int> PolygonParallelEdges(IPolygonReader poly, bool closed, Vector v)
        {
            List <int> r = new List <int>();

            Point[] p = new BoxArrayPoint(poly).Value;
            for (int i = 0, j; i < p.Length; i++)
            {
                if (i == p.Length - 1)
                {
                    j = 0;
                }
                else
                {
                    j = i + 1;
                }
                if (Funcs2D.IsParallel(v, p[j].Minus(p[i])) != 0)
                {
                    r.Add(i);
                }
            }
            return(r);
        }