Example #1
0
        /// <summary>
        /// Returns whether the point is contained inside the face.
        /// </summary>
        /// <remarks>
        /// This assumes the face is convex
        /// </remarks>
        /// <param name="a_pos"></param>
        /// <returns></returns>
        public bool Contains(Vector2 a_pos)
        {
            if (IsOuter)
            {
                // check whether point is contained inside the outer polygon of one of the innercomponents

                return(!InnerComponents.Exists(e => e.Twin.Face.PolygonWithoutHoles.ContainsInside(a_pos)));
            }

            return(Polygon.ContainsInside(a_pos));
        }
Example #2
0
 public Rational Area()
 {
     if (Bounded)
     {
         return(OuterComponent.CycleArea() - InnerComponents.Aggregate <DCEL_HalfEdge, Rational>(0, (area, inner) => area + inner.CycleArea()));
     }
     else
     {
         return(0);
     }
 }