示例#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 <Line> allLines = Perimeter.Segments();

            if (Voids != null)
            {
                allLines = allLines.Union(Voids.SelectMany(v => v.Segments()));
            }
            return(Polygon.Contains(allLines, point, out containment));
        }
示例#2
0
 /// <summary>
 /// Get all segments from a profile's perimeter and internal voids.
 /// </summary>
 public List <Line> Segments()
 {
     return(Perimeter.Segments().Union(Voids?.SelectMany(v => v.Segments()) ?? new Line[0]).ToList());
 }