Ejemplo n.º 1
0
        /// <summary>
        /// Tests if a point is contained within this profile. Returns false for points that are outside of the profile (or within voids).
        /// </summary>
        /// <param name="point">The position to test.</param>
        /// <param name="containment">Whether the point is inside, outside, at an edge, or at a vertex.</param>
        /// <returns>True if the point is within the profile.</returns>
        public bool Contains(Vector3 point, out Containment containment)
        {
            IEnumerable <(Vector3 from, Vector3 to)> allEdges = Perimeter.Edges();

            if (Voids != null)
            {
                allEdges = allEdges.Union(Voids.SelectMany(v => v.Edges()));
            }
            return(Polygon.Contains(allEdges, point, out containment));
        }