Class Face<X extends Point_>

java.lang.Object
Jcg.polyhedron.Face<X>

public class Face<X extends Point_> extends Object
A class representing a face of a polyhedral (surface or planar) mesh (Half-edge data structure)
  • Field Details

    • halfedge

      public Halfedge<X extends Point_> halfedge
      a reference to a half-edge incident to this face
    • index

      public int index
      an integer that can be used to index faces (useful for some applications)
    • tag

      public int tag
      an integer that can be used to tag faces (useful for dealing with colors, ...)
  • Constructor Details

    • Face

      public Face()
  • Method Details

    • degree

      public int degree()
      Compute the degree of the face (number of bounding edges)
    • isTriangle

      public boolean isTriangle()
      true iff the face is a triangle
    • isQuad

      public boolean isQuad()
      true iff the face is a quad
    • getVertexIndices

      public int[] getVertexIndices(Polyhedron_3<X> polyhedron)
      Return an array storing the indices of the vertices in the face

      Parameters:
      polyhedron - the input mesh
      Returns:
      array storing indices of the vertices of the face
    • getVertexCoordinates

      public Point_[] getVertexCoordinates()
      Return an array storing the geometric coordinates of the vertices of the face

      Returns:
      the points (2d or 3d) corresponding to the geometric coordinates of the face
    • getBarycenter

      public Point_ getBarycenter()
      Compute and return the barycenter (2d or 3d) of the vertices of the face

      Returns:
      the barycenter of the vertices of the face
    • setEdge

      public void setEdge(Halfedge<X> halfedge)
    • getEdge

      public Halfedge<X> getEdge()
    • toString

      public String toString()
      Overrides:
      toString in class Object