Package com.solibri.geometry.primitive2d
Interface MPolygon2d
-
- All Known Subinterfaces:
MRectangle2d
,MTriangle2d
public interface MPolygon2d extends Polygon2d
Interface for handling simple polygons without holes in the XY-plane.- Since:
- 9.10.2
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static MPolygon2d
create(Polygon2d polygon)
Creates a 2-dimensional polygon with the contents deep copied from the given polygon.static MPolygon2d
create(List<? extends Vector2d> vertices)
Creates a 2-dimensional polygon with the given vertices.void
resize(double resizeAmount)
Resizes this polygon by the given amount.void
simplify(double distance)
Simplifies this polygon by replacing closely grouped vertices with a single vertex.void
translate(Vector2d translator)
Translates the polygon by the given vector in the XY-plane.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface com.solibri.geometry.primitive2d.Polygon2d
contains, contains, distance, distance, distance, distanceSquared, distanceSquared, distanceSquared, getArea, getBoundingRectangle, getCentroid, getEdgeIterator, getOrientedBoundingRectangle, getPerimeter, getVertexCount, getVertices, intersectEdges, intersects, isConvex, isCounterClockwise, shortestSegmentTo, toArea
-
-
-
-
Method Detail
-
simplify
void simplify(double distance)
Simplifies this polygon by replacing closely grouped vertices with a single vertex. Vertices that are within the given distance of each other are considered closely grouped.- Parameters:
distance
- the distance used for checking if vertices are closely grouped- Since:
- 9.10.2
-
resize
void resize(double resizeAmount)
Resizes this polygon by the given amount. If the amount is positive, the polygon is enlarged. If the amount is negative, the polygon is reduced in size.- Parameters:
resizeAmount
- the amount the polygon is resized- Since:
- 9.10.2
-
translate
void translate(Vector2d translator)
Translates the polygon by the given vector in the XY-plane.- Parameters:
translator
- the vector used for translation- Since:
- 9.10.2
-
create
static MPolygon2d create(List<? extends Vector2d> vertices)
Creates 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
-
create
static MPolygon2d create(Polygon2d polygon)
Creates a 2-dimensional polygon with the contents deep copied from the given polygon. The returned polygon does not take ownership of the given vertices.- 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
-
-