doesOverlap static method

bool doesOverlap(
  1. List<Point<num>> polygon,
  2. List<Point<num>> otherPolygon, {
  3. PolygonType type = PolygonType.Auto,
})

Implementation

static bool doesOverlap(List<Point> polygon, List<Point> otherPolygon,
    {PolygonType type = PolygonType.Auto}) {
  switch (type) {
    case PolygonType.Concave:
      return _doesOverlapConcave(polygon, otherPolygon);
    case PolygonType.Convex:
      return _doesOverlapConvex(polygon, otherPolygon);
    case PolygonType.Auto:
      return (isConvexPolygon(polygon) && isConvexPolygon(otherPolygon))
          ? _doesOverlapConvex(polygon, otherPolygon)
          : _doesOverlapConcave(polygon, otherPolygon);
  }
}