public interface Polygon3d extends Iterable<Vector3d>
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Polygon3d polygon)
Returns true if the given polygon is contained inside this polygon.
|
boolean |
contains(Vector3d point)
Returns true if the given point is inside this polygon.
|
static Polygon3d |
create(List<? extends Vector3d> vertices)
Creates a polygon with the given vertices.
|
static Polygon3d |
create(Polygon3d polygon)
Creates a polygon with the contents deep copied from the given polygon.
|
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.
|
AABB3d |
getBoundingBox()
Returns the bounding box.
|
MVector3d |
getCentroid()
Returns the centroid of this polygon.
|
default Iterator<Segment3d> |
getEdgeIterator()
Returns an iterator that iterates through the segments in this polygon.
|
MVector3d |
getMean()
Returns the average vector of the vertices of this polygon.
|
MVector3d |
getNormal()
Returns the normal of this polygon as a vector of unit length.
|
default int |
getVertexCount()
Returns the number of vertices in this polygon.
|
List<Vector3d> |
getVertices()
Returns the vertices in this polygon.
|
Optional<MVector3d> |
intersect(Segment3d segment)
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.
|
forEach, iterator, spliterator
boolean contains(Polygon3d polygon)
polygon
- the polygon that is checked for containment inside this
polygonboolean contains(Vector3d point)
point
- the point that is checked for containment inside this
polygonboolean edgesIntersect(Polygon3d polygon)
polygon
- true if the edges of the given polygon intersect the edges
of this polygondouble getArea()
MVector3d getCentroid()
AABB3d getBoundingBox()
default Iterator<Segment3d> getEdgeIterator()
Optional<MVector3d> intersect(Segment3d segment)
segment
- the segment with which the intersection point is computedMVector3d getMean()
MVector3d getNormal()
default int getVertexCount()
List<Vector3d> getVertices()
default boolean intersects(Segment3d segment)
segment
- the segment that is checked for intersection with this
polygonboolean isConvex()
static Polygon3d create(Polygon3d polygon)
polygon
- the polygon whose contents are deep copied into the returned
polygonstatic Polygon3d create(List<? extends Vector3d> vertices)
vertices
- the vertices used for creating the returned polygonCopyright © 2019 Solibri, Inc.. All rights reserved.