/// <summary>
        /// Add a new linked loop to the current polygon
        /// </summary>
        /// <returns></returns>
        public LinkedGeoLoop addNewLinkedLoop()
        {
            //LinkedGeoLoop* loop = calloc(1, sizeof(*loop));
            var loop = new LinkedGeoLoop();

            //return addLinkedLoop(polygon, loop);
            return(addLinkedLoop(loop));
        }
        /// <summary>
        /// Add an existing linked loop to the current polygon
        /// </summary>
        /// <param name="loop"></param>
        /// <returns>New loop</returns>
        public LinkedGeoLoop addLinkedLoop(LinkedGeoLoop loop)
        {
            if (last == null)
            {
                //assert(polygon->first == NULL);
                if (First != null)
                {
                    throw new ArgumentException("expected polygon.first to be null");
                }

                First = loop;
            }
            else
            {
                last.Next = loop;
            }

            last = loop;

            return(loop);
        }