Esempio n. 1
0
        /// <summary>
        /// Calculates the absolute polygon of a region given a new location,
        /// using the region's reference point and relative polygon
        /// </summary>
        /// <param name="location"></param>
        /// <param name="region"></param>
        /// <returns></returns>
        private Polygon3D GetAbsolutePolygon(Vec2D refPoint, Polygon2D relativePolygon)
        {
            //Vec2D difference = refPoint.VectorDistanceTo(location);
            Polygon3D absolute = new Polygon3D(0, 0);

            foreach (Vec2D vertex in relativePolygon.getVertices())
            {
                absolute.AddVertex(vertex.Add(refPoint));
            }
            return(absolute);
        }