Package org.seamcat.model.geometry
Class PolygonUtil
- java.lang.Object
-
- org.seamcat.model.geometry.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 togetherstatic 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)
-
-
-
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 circleturnAngle
- the angle to turn the resulting polygonedgeCount
- number of edges of the restricted polygon- Returns:
- convex polygon turned and shapes as per inputs
-
add
public static Polygon2D add(Bounds rectangleX, Bounds rectangleY, Polygon2D polygon)
Add a rectangle and a polygon together
-
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)
-
allPoints
public static java.util.List<Point2D> allPoints(SystemSpaces shapes)
-
-