Class PolygonUtil


  • public class PolygonUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      PolygonUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Polygon2D add​(Bounds rectangleX, Bounds rectangleY, Polygon2D polygon)
      Add a rectangle and a polygon together
      static java.util.List<Point2D> allPoints​(SystemSpaces shapes)  
      static Polygon2D convertCircle​(double radius, double turnAngle, int edgeCount)  
      static Polygon2D convertCircle​(double radius, double turnAngle, int edgeCount, Bounds angles)
      Restrict the circle with given radius into a convex polygon with the given number of edges.
      protected static Point2D find​(Polygon2D polygon, org.seamcat.model.geometry.PolygonUtil.PointCompare primary, org.seamcat.model.geometry.PolygonUtil.PointCompare secondary)  
      static Point2D getRandomPointInside​(Polygon2D polygon)  
      protected static java.util.Map<org.seamcat.model.geometry.PolygonUtil.Orientation,​java.util.List<Point2D>> map​(Polygon2D polygon)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PolygonUtil

        public PolygonUtil()
    • Method Detail

      • convertCircle

        public static Polygon2D convertCircle​(double radius,
                                              double turnAngle,
                                              int edgeCount)
      • convertCircle

        public static Polygon2D convertCircle​(double radius,
                                              double turnAngle,
                                              int edgeCount,
                                              Bounds angles)
        Restrict the circle with given radius into a convex polygon with the given number of edges.
        Parameters:
        radius - radius of the enclosing circle
        turnAngle - the angle to turn the resulting polygon
        edgeCount - number of edges of the restricted polygon
        Returns:
        convex polygon turned and shapes as per inputs
      • find

        protected static Point2D find​(Polygon2D polygon,
                                      org.seamcat.model.geometry.PolygonUtil.PointCompare primary,
                                      org.seamcat.model.geometry.PolygonUtil.PointCompare secondary)
      • map

        protected static java.util.Map<org.seamcat.model.geometry.PolygonUtil.Orientation,​java.util.List<Point2D>> map​(Polygon2D polygon)
      • getRandomPointInside

        public static Point2D getRandomPointInside​(Polygon2D polygon)