Package com.solibri.geometry.primitive3d
Interface Triangle3d
-
- All Known Subinterfaces:
MTriangle3d
public interface Triangle3d extends Polygon3d
Read-only interface for 3-dimensional triangles.- Since:
- 9.10.2
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Triangle3d
create(Vector3d firstPoint, Vector3d secondPoint, Vector3d thirdPoint)
Creates a new instance.static Triangle3d
create(Triangle3d other)
Creates a new instance.static Triangle3d
create(List<? extends Vector3d> points)
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.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface com.solibri.geometry.primitive3d.Polygon3d
contains, contains, edgesIntersect, getArea, getCentroid, getEdgeIterator, getMean, getNormal, getVertexCount, getVertices, intersect, intersects, isConvex
-
-
-
-
Method Detail
-
getFirstPoint
Vector3d getFirstPoint()
Returns the first point of the triangle.- Returns:
- the first point of the triangle
- Since:
- 9.10.2
-
getSecondPoint
Vector3d getSecondPoint()
Returns the second point of the triangle.- Returns:
- the second point of the triangle
- Since:
- 9.10.2
-
getThirdPoint
Vector3d getThirdPoint()
Returns the third point of the triangle.- Returns:
- the third point of the triangle
- Since:
- 9.10.2
-
getCrossProduct
MVector3d getCrossProduct()
Returns the cross product of this triangle. The resulting vector is not normalized.- Returns:
- the cross product resulting vector
- Since:
- 9.10.2
-
intersects
boolean intersects(Ray3d ray)
Returns true if the triangle intersects the given ray.- Parameters:
ray
- the ray- Returns:
- true if they intersect, false otherwise
- Since:
- 9.10.2
-
intersect
Optional<MVector3d> intersect(Ray3d ray)
Returns an optional with the intersection point between the triangle and the ray if present, otherwise an empty optional.- Parameters:
ray
- the ray- Returns:
- an optional with the intersection point if existing, otherwise an empty optional
- Since:
- 9.10.2
-
intersects
boolean intersects(Line3d line)
Returns true if the triangle intersects the given line.- Parameters:
line
- the line- Returns:
- true if they intersect, false otherwise
- Since:
- 9.10.2
-
intersect
Optional<MVector3d> intersect(Line3d line)
Returns an optional with the intersection point between the triangle and the line if present, otherwise an empty optional.- Parameters:
line
- the line- Returns:
- an optional with the intersection point if existing, otherwise an empty optional
- Since:
- 9.10.2
-
getBoundingBox
AABB3d getBoundingBox()
Returns the axis-aligned bounding box of this triangle.- Specified by:
getBoundingBox
in interfacePolygon3d
- Returns:
- the axis-aligned bounding box of this triangle
- Since:
- 9.10.2
-
intersects
boolean intersects(MTriangle3d triangle)
Returns true if the triangles intersect, false otherwise.- Parameters:
triangle
- the triangle- Returns:
- true if the triangles intersect, false otherwise
- Since:
- 9.10.2
-
create
static Triangle3d create(List<? extends Vector3d> points)
Creates a new instance.- Parameters:
points
- list of points- Returns:
- the newly created instance
- Throws:
IllegalArgumentException
- if the list does not contain exactly three points- Since:
- 9.10.2
-
create
static Triangle3d create(Vector3d firstPoint, Vector3d secondPoint, Vector3d thirdPoint)
Creates a new instance.- Parameters:
firstPoint
- the first pointsecondPoint
- the second pointthirdPoint
- the thirdPoint- Returns:
- the newly created instance
- Throws:
IllegalArgumentException
- if the list does not contain exactly three points- Since:
- 9.10.2
-
create
static Triangle3d create(Triangle3d other)
Creates a new instance.- Parameters:
other
- the other triangle- Returns:
- the newly created instance
- Since:
- 9.10.2
-
-