Package com.solibri.geometry.primitive2d
Interface Area
- All Known Subinterfaces:
MArea
public interface Area
Read-only interface for handling areas in XY-plane. The area object is an
enclosed area of 2D space that can have holes.
- Since:
- 9.10.2
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if the area contains the given point.static Area
create()
Returns an empty area.static Area
Creates an area with the given area.static Area
Creates an area with the given polygon and resize value.static Area
Creates an area with the givenShape
.static Area
create
(Collection<? extends Area> areas) Creates an union area with the given areas.static Area
Creates an area with the given polygon points.Returns a copy of a bounding rectangle which has minimum area and is axis aligned.Returns the centroid of this area.getHoles()
Returns a list of holes in the area.Returns the largest outer polygon of the area.Returns the minimum area bounding rectangle.Returns a list of polygons in the area.double
getSize()
Returns the size of the area.Returns a list of vertices in the area.boolean
isEmpty()
Tests whether this area object encloses any area.boolean
Tests whether this area is comprised of a single closed subpath.
-
Method Details
-
create
Returns an empty area.- Returns:
- an empty area.
- Since:
- 9.10.2
-
create
Creates an area with the given polygon points. The area does not take ownership of the given points.- Parameters:
polygonPoints
- the points used for creating the area- Returns:
- an area with the given polygon points
- Since:
- 9.10.2
-
create
Creates an area with the given area. The returned area does not take ownership of the given area.- Parameters:
area
- the area used for creating the returned area- Returns:
- an area with the given area
- Since:
- 9.10.2
-
create
Creates an area with the given polygon and resize value. The returned area does not take ownership of the given polygon.- Parameters:
polygon
- the polygon used for creating the returned arearesize
- the amount of resize used for creating the returned area- Returns:
- the area with the given resized polygon
- Since:
- 9.10.2
-
create
Creates an union area with the given areas. The returned area does not take ownership of the given areas. The resulting shape of this area will include the union of all shapes, or all areas that were contained in either this or the specified areas.- Parameters:
areas
- the areas used for creating the returned area- Returns:
- an area with the given area
- Since:
- 9.10.2
-
create
Creates an area with the givenShape
. The returned area does not take ownership of the given area.- Parameters:
shape
- the shape used for creating the returned area- Returns:
- an area with the given area
- Since:
- 9.10.2
-
contains
Checks if the area contains the given point.- Parameters:
point
- the point- Returns:
- true if the point is located inside the area, false otherwise
- Since:
- 9.10.2
-
getMinimumBoundingRectangle
Rectangle2d getMinimumBoundingRectangle()Returns the minimum area bounding rectangle. Note: Don't use this with empty areas.- Returns:
- the minimum area bounding rectangle
- Since:
- 9.10.2
-
getSize
double getSize()Returns the size of the area.- Returns:
- the size of the area
- Since:
- 9.10.2
-
getHoles
List<MPolygon2d> getHoles()Returns a list of holes in the area.- Returns:
- list of holes in the area
- Since:
- 9.10.2
-
getLargestPolygon
MPolygon2d getLargestPolygon()Returns the largest outer polygon of the area.- Returns:
- the largest polygon
- Since:
- 9.10.2
-
getPolygons
List<MPolygon2d> getPolygons()Returns a list of polygons in the area.- Returns:
- list of polygons in the area
- Since:
- 9.10.2
-
getVertices
Returns a list of vertices in the area.- Returns:
- list of vertices in the area
- Since:
- 9.10.2
-
isEmpty
boolean isEmpty()Tests whether this area object encloses any area.- Returns:
- true if this area represents an empty area, false otherwise
- Since:
- 9.10.2
-
isSingular
boolean isSingular()Tests whether this area is comprised of a single closed subpath. This method returns true if the path contains 0 or 1 subpaths, or false if the path contains more than 1 subpath.- Returns:
- true if the area is comprised of a single basic geometry, false otherwise
- Since:
- 9.10.2
-
getBoundingRectangle
MAABB2d getBoundingRectangle()Returns a copy of a bounding rectangle which has minimum area and is axis aligned.- Returns:
- bounding rectangle
- Since:
- 9.10.2
-
getCentroid
MVector2d getCentroid()Returns the centroid of this area. The centroid is the center of mass. For an empty area this returns (0, 0).- Returns:
- the centroid of this area
- Since:
- 9.10.2
-