Package com.solibri.geometry.primitive2d
Interface Polygon2d
- All Known Subinterfaces:
- MPolygon2d,- MRectangle2d,- MTriangle2d,- Rectangle2d,- Triangle2d
Read-only interface for handling simple polygons without holes in the
 XY-plane.
- Since:
- 9.10.2
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns true if the given point is inside this polygon.booleanReturns true if the given polygon is inside this polygon.static Polygon2dCreates a 2-dimensional polygon with the contents deep copied from the given polygon.static Polygon2dCreates a 2-dimensional polygon with the given vertices.default doubleReturns the distance between this polygon and the given point.default doubleReturns the minimum distance between this polygon and the given polygon.default doubleReturns the minimum distance between this polygon and the given segment.doubledistanceSquared(Vector2d point) Returns the square of the distance between this polygon and the given point.doubledistanceSquared(Polygon2d polygon) Returns the square of the distance between this polygon and the given polygon.doubledistanceSquared(Segment2d segment) Returns the square of the minimum distance between this polygon and the given segment.doublegetArea()Returns the area of this polygon.Returns a copy of the minimum area axis aligned bounding rectangle.Returns the centroid of this polygon.Returns an iterator that iterates through the edges of this polygon.Returns the minimum area oriented bounding rectangle for this polygon.doubleReturns the perimeter length of this polygon.intReturns the number of vertices in this polygon.Returns the vertices of this polygon.intersectEdges(Segment2d segment) Returns all intersection points between the edges of this polygon and the given segment.booleanintersects(Polygon2d polygon) Returns true if this polygon intersects the given polygon.booleanisConvex()Returns true if this polygon is convex.booleanReturns true if the vertices of this polygon are in counter clockwise order.shortestSegmentTo(Polygon2d polygon) Returns the shortest segment between this polygon and the given polygon.toArea()Returns this polygon as anMAreaobject.Methods inherited from interface java.lang.IterableforEach, iterator, spliterator
- 
Method Details- 
containsReturns true if the given polygon is inside this polygon.- Parameters:
- polygon- the polygon that is checked for containment inside this polygon
- Returns:
- true if the given polygon is inside this polygon
- Since:
- 9.10.2
 
- 
containsReturns true if the given point is inside this polygon.- Parameters:
- point- the point that is checked for containment inside this polygon
- Returns:
- true if the given point is inside this polygon
- Since:
- 9.10.2
 
- 
distanceReturns the minimum distance between this polygon and the given polygon.- Parameters:
- polygon- the polygon to which the distance is computed
- Returns:
- the distance between this polygon and the given polygon
- Since:
- 9.10.2
 
- 
distanceReturns the minimum distance between this polygon and the given segment. If the segment intersects this polygon, then returns zero.- Parameters:
- segment- the segment to which the distance is computed
- Returns:
- the minimum distance between this polygon and the given segment
- Since:
- 9.10.2
 
- 
distanceReturns the distance between this polygon and the given point.- Parameters:
- point- the point to which the distance is computed
- Returns:
- the distance between this polygon and the given point
- Since:
- 9.10.2
 
- 
distanceSquaredReturns the square of the distance between this polygon and the given polygon.- Parameters:
- polygon- the polygon to which the squared distance is computed
- Returns:
- the square of the distance between this polygon and the given polygon
- Since:
- 9.10.2
 
- 
distanceSquaredReturns the square of the minimum distance between this polygon and the given segment. If the segment intersects this polygon, then returns zero.- Parameters:
- segment- the segment to which the squared distance is computed
- Returns:
- the square of the minimum distance between this polygon and the given segment
- Since:
- 9.10.2
 
- 
distanceSquaredReturns the square of the distance between this polygon and the given point.- Parameters:
- point- the point to which the squared distance is computed
- Returns:
- the square of the distance between this polygon and the given point
- Since:
- 9.10.2
 
- 
getAreadouble getArea()Returns the area of this polygon.- Returns:
- the area of this polygon
- Since:
- 9.10.2
 
- 
getCentroidMVector2d getCentroid()Returns the centroid of this polygon. The centroid is the center of mass.- Returns:
- the centroid of this polygon
- Since:
- 9.10.2
 
- 
getBoundingRectangleMAABB2d getBoundingRectangle()Returns a copy of the minimum area axis aligned bounding rectangle.- Returns:
- bounding rectangle whose lower and upper points are the lower and upper points from the bounding rectangle
- Since:
- 9.10.2
 
- 
getOrientedBoundingRectangleMRectangle2d getOrientedBoundingRectangle()Returns the minimum area oriented bounding rectangle for this polygon.- Returns:
- the minimum area oriented bounding rectangle for this polygon
- Since:
- 9.10.2
 
- 
getEdgeIteratorReturns an iterator that iterates through the edges of this polygon.- Returns:
- an iterator that iterates through the edges of this polygon
- Since:
- 9.10.2
 
- 
getPerimeterdouble getPerimeter()Returns the perimeter length of this polygon.- Returns:
- the perimeter length of this polygon
- Since:
- 9.10.2
 
- 
intersectEdgesReturns all intersection points between the edges of this polygon and the given segment. If this segment and the polygon do not intersect, then returns an empty collection.- Parameters:
- segment- the segment with which the intersections are computed
- Returns:
- all intersection points between the edges of this polygon and the given segment
- Since:
- 9.10.2
 
- 
shortestSegmentToReturns the shortest segment between this polygon and the given polygon. The start point of the segment is in this polygon and the end point is in the given polygon. If the polygons intersect, then the segment is of zero length.- Parameters:
- polygon- the polygon to which the shortest distance segment is returned
- Returns:
- the shortest segment between this polygon and the given polygon
- Since:
- 9.10.2
 
- 
getVertexCountint getVertexCount()Returns the number of vertices in this polygon.- Returns:
- the number of vertices in this polygon
- Since:
- 9.10.2
 
- 
getVerticesReturns the vertices of this polygon.- Returns:
- the vertices of this polygon
- Since:
- 9.10.2
 
- 
intersectsReturns true if this polygon intersects the given polygon.- Parameters:
- polygon- the polygon that is checked for intersection with this polygon
- Returns:
- true if this polygon intersects the given polygon
- Since:
- 9.10.2
 
- 
isCounterClockwiseboolean isCounterClockwise()Returns true if the vertices of this polygon are in counter clockwise order.- Returns:
- true if the vertices of this polygon are in counter clockwise order
- Since:
- 9.10.2
 
- 
isConvexboolean isConvex()Returns true if this polygon is convex.- Returns:
- true if this polygon is convex
- Since:
- 9.10.2
 
- 
toAreaMArea toArea()Returns this polygon as anMAreaobject.- Returns:
- this polygon as an MAreaobject
- Since:
- 9.10.2
 
- 
createCreates a 2-dimensional polygon with the given vertices. The returned polygon does not take ownership of the given vertices.- Parameters:
- vertices- the vertices used for creating the returned polygon
- Returns:
- a polygon with the given vertices
- Since:
- 9.10.2
 
- 
createCreates a 2-dimensional polygon with the contents deep copied from the given polygon. The returned polygon does not take ownership of the given polygon.- Parameters:
- polygon- the polygon whose contents are deep copied into the returned polygon
- Returns:
- a polygon with the contents deep copied from the given polygon
- Since:
- 9.10.2
 
 
-