Interface Triangle3d

All Superinterfaces:
Iterable<Vector3d>, Polygon3d
All Known Subinterfaces:
MTriangle3d

public interface Triangle3d
extends Polygon3d
Read-only interface for 3-dimensional triangles.
Since:
9.10.2
  • Method Details

    • 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 interface Polygon3d
      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 point
      secondPoint - the second point
      thirdPoint - 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