public interface Triangle3d extends Polygon3d
Modifier and Type | Method and Description |
---|---|
static Triangle3d |
create(List<? extends Vector3d> points)
Creates a new instance.
|
static Triangle3d |
create(Triangle3d other)
Creates a new instance.
|
static Triangle3d |
create(Vector3d firstPoint,
Vector3d secondPoint,
Vector3d thirdPoint)
Creates a new instance.
|
AABB3d |
getBoundingBox()
Returns the axis-aligned bounding box of this triangle.
|
MVector3d |
getCrossProduct()
Returns the cross product of this triangle.
|
Vector3d |
getFirstPoint()
Returns the first point of the triangle.
|
Vector3d |
getSecondPoint()
Returns the second point of the triangle.
|
Vector3d |
getThirdPoint()
Returns the third point of the triangle.
|
Optional<MVector3d> |
intersect(Line3d line)
Returns an optional with the intersection point between the triangle and the
line if present, otherwise an empty optional.
|
Optional<MVector3d> |
intersect(Ray3d ray)
Returns an optional with the intersection point between the triangle and the
ray if present, otherwise an empty optional.
|
boolean |
intersects(Line3d line)
Returns true if the triangle intersects the given line.
|
boolean |
intersects(MTriangle3d triangle)
Returns true if the triangles intersect, false otherwise.
|
boolean |
intersects(Ray3d ray)
Returns true if the triangle intersects the given ray.
|
contains, contains, create, edgesIntersect, getArea, getCentroid, getEdgeIterator, getMean, getNormal, getVertexCount, getVertices, intersect, intersects, isConvex
forEach, iterator, spliterator
Vector3d getFirstPoint()
Vector3d getSecondPoint()
Vector3d getThirdPoint()
MVector3d getCrossProduct()
boolean intersects(Ray3d ray)
ray
- the rayOptional<MVector3d> intersect(Ray3d ray)
ray
- the rayboolean intersects(Line3d line)
line
- the lineOptional<MVector3d> intersect(Line3d line)
line
- the lineAABB3d getBoundingBox()
getBoundingBox
in interface Polygon3d
boolean intersects(MTriangle3d triangle)
triangle
- the trianglestatic Triangle3d create(List<? extends Vector3d> points)
create
in interface Polygon3d
points
- list of pointsIllegalArgumentException
- if the list does not contain exactly three
pointsstatic Triangle3d create(Vector3d firstPoint, Vector3d secondPoint, Vector3d thirdPoint)
firstPoint
- the first pointsecondPoint
- the second pointthirdPoint
- the thirdPointIllegalArgumentException
- if the list does not contain exactly three
pointsstatic Triangle3d create(Triangle3d other)
other
- the other triangleCopyright © 2019 Solibri, Inc.. All rights reserved.