Package com.solibri.geometry.primitive2d
Interface MPolygon2d
- All Known Subinterfaces:
MRectangle2d
,MTriangle2d
Interface for handling simple polygons without holes in the XY-plane.
- Since:
- 9.10.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic MPolygon2d
Creates a 2-dimensional polygon with the contents deep copied from the given polygon.static MPolygon2d
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
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 Details
-
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
Translates the polygon by the given vector in the XY-plane.- Parameters:
translator
- the vector used for translation- Since:
- 9.10.2
-
create
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
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
-