Package com.solibri.geometry.primitive3d
Interface Polygon3d
- All Known Subinterfaces:
MPolygon3d
,MRectangle3d
,MTriangle3d
,Rectangle3d
,Triangle3d
Read-only interface for handling simple polygons without holes in
3-dimensional space.
- Since:
- 9.10.2
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the given point is inside this polygon.boolean
Returns true if the given polygon is contained inside this polygon.static Polygon3d
Creates a polygon with the contents deep copied from the given polygon.static Polygon3d
Creates a polygon with the given vertices.boolean
edgesIntersect
(Polygon3d polygon) Returns true if the edges of the given polygon intersect the edges of this polygon.double
getArea()
Returns the area of this polygon.Returns the bounding box.Returns the centroid of this polygon.Returns an iterator that iterates through the segments in this polygon.getMean()
Returns the average vector of the vertices of this polygon.Returns the normal of this polygon as a vector of unit length.default int
Returns the number of vertices in this polygon.Returns the vertices in this polygon.Returns the intersection point of this polygon and the given segment.default boolean
intersects
(Segment3d segment) Returns true if the given segment intersects this polygon.boolean
isConvex()
Returns true if this polygon is convex.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
contains
Returns true if the given polygon is contained inside this polygon. The polygon needs to be completely inside this polygon, i.e., if the vertices or edges of the polygons intersect, then returns false.- Parameters:
polygon
- the polygon that is checked for containment inside this polygon- Returns:
- true if the given polygon is contained inside this polygon
- Since:
- 9.10.2
-
contains
Returns true if the given point is inside this polygon. If the point is on an edge of the polygon, then it is considered to be inside the 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
-
edgesIntersect
Returns true if the edges of the given polygon intersect the edges of this polygon.- Parameters:
polygon
- true if the edges of the given polygon intersect the edges of this polygon- Returns:
- true if the edges of the given polygon intersect the edges of this polygon
- Since:
- 9.10.2
-
getArea
double getArea()Returns the area of this polygon.- Returns:
- the area of this polygon
- Since:
- 9.10.2
-
getCentroid
MVector3d getCentroid()Returns the centroid of this polygon. The centroid of a polygon is the average vector of the vertices.- Returns:
- the centroid of this polygon
- Since:
- 9.10.2
-
getBoundingBox
AABB3d getBoundingBox()Returns the bounding box. The returned bounding box may be degenerate if the polygon is degenerate.- Returns:
- bounding box whose lower and upper points are the lower and upper points from the bounding box
- Since:
- 9.10.2
-
getEdgeIterator
Returns an iterator that iterates through the segments in this polygon.- Returns:
- an iterator that iterates through the segments in this polygon
- Since:
- 9.10.2
-
intersect
Returns the intersection point of this polygon and the given segment. If the segment intersects the polygon at multiple points, then which point is returned is not specified. If the segment and polygon do not intersect, then returns empty.- Parameters:
segment
- the segment with which the intersection point is computed- Returns:
- the intersection point of this polygon and the given segment
- Since:
- 9.10.2
-
getMean
MVector3d getMean()Returns the average vector of the vertices of this polygon.- Returns:
- the average vector of the vertices of this polygon
- Since:
- 9.10.2
-
getNormal
MVector3d getNormal()Returns the normal of this polygon as a vector of unit length. Returns null if the normal cannot be computed, e.g., if the polygon is not planar.- Returns:
- the normal of this polygon as a vector of unit length
- Since:
- 9.10.2
-
getVertexCount
default int getVertexCount()Returns the number of vertices in this polygon.- Returns:
- the number of vertices in this polygon
- Since:
- 9.10.2
-
getVertices
Returns the vertices in this polygon. Modifying the polygon through the list returned by this method is not supported.- Returns:
- the vertices in this polygon
- Since:
- 9.10.2
-
intersects
Returns true if the given segment intersects this polygon.- Parameters:
segment
- the segment that is checked for intersection with this polygon- Returns:
- true if the given segment intersects this polygon
- Since:
- 9.10.2
-
isConvex
boolean isConvex()Returns true if this polygon is convex.- Returns:
- true if this polygon is convex
- Since:
- 9.10.2
-
create
Creates a 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
-
create
Creates a 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
-