Interface MeshTriangle

All Superinterfaces:
Iterable<MeshPoint>, Serializable
All Known Implementing Classes:
MeshTriangleImpl

public interface MeshTriangle extends Iterable<MeshPoint>, Serializable
Adapter for the corner table representing a single triangle of MeshFacet.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Interpolation of the triangle surface points.
  • Method Summary

    Modifier and Type
    Method
    Description
    javax.vecmath.Vector3d
    Computes and returns normalized normal vector from the vertices.
    javax.vecmath.Point3d
    getClosestPoint(javax.vecmath.Point3d point)
    Computes the point laying on the triangle which is closest to given 3D point.
    List<javax.vecmath.Point3d>
    Selects the common points shared by two triangles
    javax.vecmath.Vector4d
    getCurvatureOfTrianglePlane(javax.vecmath.Point3d samplePosition, double distanceAccepted, javax.vecmath.Vector3d base1, javax.vecmath.Vector3d base2)
    Function tests if the mesh triangle is closer to the sample point than a certain distance and if is, calculates the second fundamental form of the sample point regarding the plane defined by the mesh triangle, otherwise returns null.
    Returns mesh facet backing the triangle.
    int
    Returns the index under which the vertex is stored in the array of facet vertices
    int
    Returns the index under which the vertex is stored in the array of facet vertices
    int
    Returns the index under which the vertex is stored in the array of facet vertices
    Returns mesh point of the triangle's vertex.
    Returns mesh point of the triangle's vertex.
    Returns mesh point of the triangle's vertex.
    Computes ray-triangle intersection.
    javax.vecmath.Point3d
    Returns 3D coordinates of the triangle's vertex.
    javax.vecmath.Point3d
    Returns 3D coordinates of the triangle's vertex.
    javax.vecmath.Point3d
    Returns 3D coordinates of the triangle's vertex.
    javax.vecmath.Point3d
    Return a center of circumcircle.
    boolean
    checkIntersectionWithPlane(javax.vecmath.Vector3d normal, double d)
    Checks whether the triangle is intersected by a plane
     

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • getVertex1

      javax.vecmath.Point3d getVertex1()
      Returns 3D coordinates of the triangle's vertex.
      Returns:
      3D coordinates of the triangle's vertex
    • getVertex2

      javax.vecmath.Point3d getVertex2()
      Returns 3D coordinates of the triangle's vertex.
      Returns:
      3D coordinates of the triangle's vertex
    • getVertex3

      javax.vecmath.Point3d getVertex3()
      Returns 3D coordinates of the triangle's vertex.
      Returns:
      3D coordinates of the triangle's vertex
    • getPoint1

      MeshPoint getPoint1()
      Returns mesh point of the triangle's vertex.
      Returns:
      mesh point of the triangle's vertex
    • getPoint2

      MeshPoint getPoint2()
      Returns mesh point of the triangle's vertex.
      Returns:
      mesh point of the triangle's vertex
    • getPoint3

      MeshPoint getPoint3()
      Returns mesh point of the triangle's vertex.
      Returns:
      mesh point of the triangle's vertex
    • getIndex1

      int getIndex1()
      Returns the index under which the vertex is stored in the array of facet vertices
      Returns:
      the index under which the vertex is stored in the array of facet vertices
    • getIndex2

      int getIndex2()
      Returns the index under which the vertex is stored in the array of facet vertices
      Returns:
      the index under which the vertex is stored in the array of facet vertices
    • getIndex3

      int getIndex3()
      Returns the index under which the vertex is stored in the array of facet vertices
      Returns:
      the index under which the vertex is stored in the array of facet vertices
    • getFacet

      MeshFacet getFacet()
      Returns mesh facet backing the triangle.
      Returns:
      mesh facet backing the triangle.
    • computeOrientedNormal

      javax.vecmath.Vector3d computeOrientedNormal()
      Computes and returns normalized normal vector from the vertices. This vector is in the direction of the normals of vertices of the triangle.
      Returns:
      normalized normal vector from the vertices.
    • getRayIntersection

      RayIntersectionImpl getRayIntersection(Ray ray, MeshTriangle.Smoothing smoothing)
      Computes ray-triangle intersection. Based on this article but adapted to two-side triangles.
      Parameters:
      ray - a ray
      smoothing - smoothing strategy
      Returns:
      the ray intersection or null
    • getClosestPoint

      javax.vecmath.Point3d getClosestPoint(javax.vecmath.Point3d point)
      Computes the point laying on the triangle which is closest to given 3D point. Return point is either one of the triangle's vertices, a point laying on triangles edge, or a point laying on the plane of the triangle inside the triangle boundaries.
      Parameters:
      point - 3D point
      Returns:
      the closest point or null if the input parameter is missing
    • checkIntersectionWithPlane

      boolean checkIntersectionWithPlane(javax.vecmath.Vector3d normal, double d)
      Checks whether the triangle is intersected by a plane
      Parameters:
      normal - normal defining the plane
      d - distance defining the plane
      Returns:
      true if the triangle is intersected by the plane
    • getCommonPoints

      List<javax.vecmath.Point3d> getCommonPoints(MeshTriangle other)
      Selects the common points shared by two triangles
      Parameters:
      other - The other triangle
      Returns:
      the common points of two triangles
    • iterator

      Iterator<MeshPoint> iterator()
      Specified by:
      iterator in interface Iterable<MeshPoint>
    • getVoronoiPoint

      javax.vecmath.Point3d getVoronoiPoint()
      Return a center of circumcircle. This point represents the point of Voronoi area used for Delaunay triangulation, for instance.
      Returns:
      the center of circumcircle
    • getCurvatureOfTrianglePlane

      javax.vecmath.Vector4d getCurvatureOfTrianglePlane(javax.vecmath.Point3d samplePosition, double distanceAccepted, javax.vecmath.Vector3d base1, javax.vecmath.Vector3d base2)
      Function tests if the mesh triangle is closer to the sample point than a certain distance and if is, calculates the second fundamental form of the sample point regarding the plane defined by the mesh triangle, otherwise returns null.

      For more details, see: V. Interrante et al.: Conveying the 3D shape of smoothly curving transparent surfaces via texture, 1997, doi: 10.1109/2945.597794

      Parameters:
      samplePosition - position of a point on model's surface selected to be a glyph
      distanceAccepted - squared distance; the triangle needs to be closer to the sample point than this distance to be taken into account
      base1 - first vector of orthogonal base; the base consists of three vectors: the normal of the sample point and two vectors(base1 and base2) defining the tangent plane of the model at the sample point
      base2 - second vector of orthogonal base; the base consists of three vectors: the normal of the sample point and two vectors(base1 and base2) defining the tangent plane of the model at the sample point
      Returns:
      curvature of the sample point represented by the rate the surface normal tips in the directions of orthogonal base