public bool Contains(Vector2 point) { if (!_boundingBox.Contains(point)) { return(false); } else { return(Contours.Select(c => c.WindingNumber(point)).Sum() > 0); } }
public double Distance2(Vector2 point) { if (this.Contains(point)) { return(0); } else if (this.IsEmpty) { return(double.PositiveInfinity); } else { return(Contours.Select(c => PolylineUtils.Distance2(point, c)).Min()); } }
public int CountVertices() { return(Contours.Select(contour => contour.Vertices.Count).Sum()); }
// Assumes contour orientation is canonic (counterclockwise for outer contours, clockwise for inner contours) public double Area() { return(Contours.Select(contour => contour.SignedArea()).Sum()); }