us.ihmc.utilities.math.geometry
Class ConvexPolygon2dTestHelpers
java.lang.Object
us.ihmc.utilities.math.geometry.ConvexPolygon2dTestHelpers
public class ConvexPolygon2dTestHelpers
- extends java.lang.Object
Method Summary |
static FrameConvexPolygon2d |
constructPolygon(ReferenceFrame referenceFrame,
double[][] points)
|
static boolean |
doesLineIntersectPolygon(FrameConvexPolygon2d polygon,
FrameLine2d line)
|
static java.util.ArrayList<FramePoint2d> |
generateRandomCircularFramePoints(java.util.Random random,
ReferenceFrame zUpFrame,
double xMin,
double xMax,
double yMin,
double yMax,
int numberOfPoints)
|
static FrameConvexPolygon2d |
generateRandomPolygon(java.util.Random random,
ReferenceFrame zUpFrame,
double xMin,
double xMax,
double yMin,
double yMax,
int numberOfPoints)
|
static java.util.ArrayList<FrameConvexPolygon2d> |
generateRandomPolygons(java.util.Random random,
ReferenceFrame zUpFrame,
double xMin,
double xMax,
double yMin,
double yMax,
double widthMax,
double heightMax,
int numberOfPoints,
int numberOfPolygons)
|
static java.util.ArrayList<FramePoint2d> |
generateRandomRectangularFramePoints(java.util.Random random,
ReferenceFrame zUpFrame,
double xMin,
double xMax,
double yMin,
double yMax,
int numberOfPoints)
|
static boolean |
isLineBetweenOrIntersectingVertices(FrameLine2d frameLine2d,
FramePoint2d leftVertex,
FramePoint2d rightVertex)
|
static boolean |
isLineBetweenVertices(FrameLine2d frameLine2d,
FramePoint2d leftVertex,
FramePoint2d rightVertex,
boolean mustBeStrictlyBetween)
|
static boolean |
isLineStrictlyBetweenVertices(FrameLine2d frameLine2d,
FramePoint2d leftVertex,
FramePoint2d rightVertex)
|
static void |
verifyAroundTheCornerEdges(FrameConvexPolygon2d polygon,
FramePoint2d observingPoint,
FramePoint2d[] lineOfSightVertices,
FrameLineSegment2d[] aroundTheCornerEdges)
|
static void |
verifyLineDoesNotIntersectPolygon(FrameLine2d frameLine2d,
FrameConvexPolygon2d polygon)
|
static void |
verifyLineDoesNotIntersectsPolygon(FrameConvexPolygon2d polygon,
FrameLine2d line)
|
static void |
verifyLineIntersectsEdge(FrameLine2d frameLine2d,
FrameLineSegment2d[] intersectingEdges)
|
static void |
verifyLineIntersectsPolygon(FrameConvexPolygon2d polygon,
FrameLine2d line)
|
static void |
verifyLineOfSightVertices(FrameConvexPolygon2d polygon,
FramePoint2d observingPoint,
FramePoint2d[] lineOfSightVertices)
|
static void |
verifyLinesDoNotIntersectPolygon(FrameConvexPolygon2d polygon,
java.util.ArrayList<FrameLine2d> lines)
|
static void |
verifyLineSegmentDoesNotIntersectsPolygon(FrameConvexPolygon2d polygon,
FrameLineSegment2d lineSegment)
|
static void |
verifyLineSegmentIntersectsPolygon(FrameConvexPolygon2d polygon,
FrameLineSegment2d lineSegment)
|
static void |
verifyLineSegmentsDoNotIntersectPolygon(FrameConvexPolygon2d polygon,
java.util.ArrayList<FrameLineSegment2d> lineSegments)
|
static void |
verifyLineSegmentsIntersectPolygon(FrameConvexPolygon2d polygon,
java.util.ArrayList<FrameLineSegment2d> lineSegments)
|
static void |
verifyLinesIntersectPolygon(FrameConvexPolygon2d polygon,
java.util.ArrayList<FrameLine2d> lines)
|
static void |
verifyListContains(java.util.ArrayList<FramePoint2d> framePoints,
FramePoint2d framePointToTest,
double epsilon)
|
static void |
verifyOrthogonalProjection(FrameConvexPolygon2d polygon,
FramePoint2d testPoint,
FramePoint2d projectionPoint)
|
static void |
verifyPointsAreClockwise(java.util.ArrayList<FramePoint2d> clockwisePoints)
|
static void |
verifyPointsAreClockwise(FrameConvexPolygon2d polygon)
|
static void |
verifyPointsAreInside(FrameConvexPolygon2d polygon,
java.util.ArrayList<FramePoint2d> pointsThatShouldBeInside,
double epsilon)
|
static void |
verifyPointsAreNotInside(FrameConvexPolygon2d polygon,
java.util.ArrayList<FramePoint2d> pointsThatShouldNotBeInside,
double epsilon)
|
static void |
verifyPointsAreOnLine(FramePoint2d[] intersectingPoints,
FrameLine2d line)
|
static void |
verifyPointsAreOnLineSegment(FramePoint2d[] intersectingPoints,
FrameLineSegment2d lineSegment)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConvexPolygon2dTestHelpers
public ConvexPolygon2dTestHelpers()
constructPolygon
public static FrameConvexPolygon2d constructPolygon(ReferenceFrame referenceFrame,
double[][] points)
verifyPointsAreClockwise
public static void verifyPointsAreClockwise(FrameConvexPolygon2d polygon)
verifyPointsAreClockwise
public static void verifyPointsAreClockwise(java.util.ArrayList<FramePoint2d> clockwisePoints)
verifyListContains
public static void verifyListContains(java.util.ArrayList<FramePoint2d> framePoints,
FramePoint2d framePointToTest,
double epsilon)
verifyOrthogonalProjection
public static void verifyOrthogonalProjection(FrameConvexPolygon2d polygon,
FramePoint2d testPoint,
FramePoint2d projectionPoint)
generateRandomPolygons
public static java.util.ArrayList<FrameConvexPolygon2d> generateRandomPolygons(java.util.Random random,
ReferenceFrame zUpFrame,
double xMin,
double xMax,
double yMin,
double yMax,
double widthMax,
double heightMax,
int numberOfPoints,
int numberOfPolygons)
generateRandomPolygon
public static FrameConvexPolygon2d generateRandomPolygon(java.util.Random random,
ReferenceFrame zUpFrame,
double xMin,
double xMax,
double yMin,
double yMax,
int numberOfPoints)
generateRandomCircularFramePoints
public static java.util.ArrayList<FramePoint2d> generateRandomCircularFramePoints(java.util.Random random,
ReferenceFrame zUpFrame,
double xMin,
double xMax,
double yMin,
double yMax,
int numberOfPoints)
generateRandomRectangularFramePoints
public static java.util.ArrayList<FramePoint2d> generateRandomRectangularFramePoints(java.util.Random random,
ReferenceFrame zUpFrame,
double xMin,
double xMax,
double yMin,
double yMax,
int numberOfPoints)
verifyAroundTheCornerEdges
public static final void verifyAroundTheCornerEdges(FrameConvexPolygon2d polygon,
FramePoint2d observingPoint,
FramePoint2d[] lineOfSightVertices,
FrameLineSegment2d[] aroundTheCornerEdges)
verifyLineOfSightVertices
public static void verifyLineOfSightVertices(FrameConvexPolygon2d polygon,
FramePoint2d observingPoint,
FramePoint2d[] lineOfSightVertices)
verifyLineDoesNotIntersectPolygon
public static void verifyLineDoesNotIntersectPolygon(FrameLine2d frameLine2d,
FrameConvexPolygon2d polygon)
verifyLineIntersectsEdge
public static void verifyLineIntersectsEdge(FrameLine2d frameLine2d,
FrameLineSegment2d[] intersectingEdges)
isLineBetweenOrIntersectingVertices
public static boolean isLineBetweenOrIntersectingVertices(FrameLine2d frameLine2d,
FramePoint2d leftVertex,
FramePoint2d rightVertex)
isLineStrictlyBetweenVertices
public static boolean isLineStrictlyBetweenVertices(FrameLine2d frameLine2d,
FramePoint2d leftVertex,
FramePoint2d rightVertex)
isLineBetweenVertices
public static boolean isLineBetweenVertices(FrameLine2d frameLine2d,
FramePoint2d leftVertex,
FramePoint2d rightVertex,
boolean mustBeStrictlyBetween)
verifyPointsAreInside
public static void verifyPointsAreInside(FrameConvexPolygon2d polygon,
java.util.ArrayList<FramePoint2d> pointsThatShouldBeInside,
double epsilon)
verifyPointsAreNotInside
public static void verifyPointsAreNotInside(FrameConvexPolygon2d polygon,
java.util.ArrayList<FramePoint2d> pointsThatShouldNotBeInside,
double epsilon)
verifyLinesIntersectPolygon
public static void verifyLinesIntersectPolygon(FrameConvexPolygon2d polygon,
java.util.ArrayList<FrameLine2d> lines)
verifyLineSegmentsIntersectPolygon
public static void verifyLineSegmentsIntersectPolygon(FrameConvexPolygon2d polygon,
java.util.ArrayList<FrameLineSegment2d> lineSegments)
verifyLinesDoNotIntersectPolygon
public static void verifyLinesDoNotIntersectPolygon(FrameConvexPolygon2d polygon,
java.util.ArrayList<FrameLine2d> lines)
verifyLineSegmentsDoNotIntersectPolygon
public static void verifyLineSegmentsDoNotIntersectPolygon(FrameConvexPolygon2d polygon,
java.util.ArrayList<FrameLineSegment2d> lineSegments)
verifyLineIntersectsPolygon
public static void verifyLineIntersectsPolygon(FrameConvexPolygon2d polygon,
FrameLine2d line)
verifyPointsAreOnLine
public static void verifyPointsAreOnLine(FramePoint2d[] intersectingPoints,
FrameLine2d line)
verifyPointsAreOnLineSegment
public static void verifyPointsAreOnLineSegment(FramePoint2d[] intersectingPoints,
FrameLineSegment2d lineSegment)
verifyLineSegmentIntersectsPolygon
public static void verifyLineSegmentIntersectsPolygon(FrameConvexPolygon2d polygon,
FrameLineSegment2d lineSegment)
verifyLineDoesNotIntersectsPolygon
public static void verifyLineDoesNotIntersectsPolygon(FrameConvexPolygon2d polygon,
FrameLine2d line)
doesLineIntersectPolygon
public static boolean doesLineIntersectPolygon(FrameConvexPolygon2d polygon,
FrameLine2d line)
verifyLineSegmentDoesNotIntersectsPolygon
public static void verifyLineSegmentDoesNotIntersectsPolygon(FrameConvexPolygon2d polygon,
FrameLineSegment2d lineSegment)