Module imp3d

Class Tetrahedron

java.lang.Object
de.grogra.imp3d.math.delaunay.Tetrahedron
All Implemented Interfaces:
Serializable, Iterable<OrientedFace>

public class Tetrahedron extends Object implements Iterable<OrientedFace>, Serializable
An oriented, delaunay tetrahedral cell. The vertices of the tetrahedron are A, B, C and D. The vertices {A, B, C} are positively oriented with respect to the fourth vertex D.

Author:
Hal Hildebrand
See Also:
  • Constructor Details

    • Tetrahedron

      public Tetrahedron(VoronoiCell x, VoronoiCell y, VoronoiCell z, VoronoiCell w)
      Construct a tetrahedron from the four vertices
      Parameters:
      x -
      y -
      z -
      w -
    • Tetrahedron

      public Tetrahedron(VoronoiCell[] vertices)
      Construct a tetrahedron from the array of four vertices
      Parameters:
      vertices -
  • Method Details

    • addFaces

      public void addFaces(List<VoronoiCell[]> faces)
      Add the four faces defined by the tetrahedron to the list of faces
      Parameters:
      faces -
    • addFacesCoordinates

      public void addFacesCoordinates(List<Point3d[]> faces)
      Add the four faces defined by the tetrahedron to the list of faces
      Parameters:
      faces -
    • flip1to4

      public Tetrahedron flip1to4(VoronoiCell n, List<OrientedFace> ears)
      Perform the 1 -> 4 bistellar flip. This produces 4 new tetrahedron from the original tetrahdron, by inserting the new point in the interior of the receiver tetrahedron. The star set of the newly inserted point is pushed onto the supplied stack.

      Parameters:
      n - - the inserted point
      ears - - the stack of oriented faces that make up the ears of the inserted point
      Returns:
      one of the four new tetrahedra
    • getFace

      public OrientedFace getFace(V v)
      Answer the oriented face of the tetrahedron

      Parameters:
      v - - the vertex opposite the face
      Returns:
      the OrientedFace
    • getFace

      public OrientedFace getFace(VoronoiCell v)
      Answer the oriented face opposite the vertex
      Parameters:
      v -
      Returns:
    • getNeighbor

      public Tetrahedron getNeighbor(V v)
      Answer the neighbor that is adjacent to the face opposite of the vertex

      Parameters:
      v - - the opposing vertex defining the face
      Returns:
      the neighboring tetrahedron, or null if none.
    • getNeighbor

      public Tetrahedron getNeighbor(VoronoiCell vertex)
      Answer the neighbor that is adjacent to the face opposite of the vertex

      Parameters:
      vertex -
      Returns:
    • getVertex

      public VoronoiCell getVertex(V v)
      Answer the vertex of the tetrahedron
      Parameters:
      v - the vertex
      Returns:
      the vertex
    • getVertices

      public VoronoiCell[] getVertices()
      Answer the four vertices that define the tetrahedron
      Returns:
    • getVerticesPoint3d

      public Point3d[] getVerticesPoint3d()
      Answer the four vertices that define the tetrahedron
      Returns:
    • includes

      public boolean includes(VoronoiCell query)
    • inSphere

      public boolean inSphere(VoronoiCell query)
      Answer true if the query point is contained in the circumsphere of the tetrahedron
      Parameters:
      query -
      Returns:
    • iterator

      public Iterator<OrientedFace> iterator()
      Answer the iterator over the faces of the tetrahedron

      Specified by:
      iterator in interface Iterable<OrientedFace>
      Returns:
      the iterator of the faces, in the order of the index their opposite vertex
    • ordinalOf

      public V ordinalOf(VoronoiCell v)
      Answer the vertex indicator of the the point
      Parameters:
      v - - the vertex
      Returns:
      the indicator of this vertex or null if not a vertex of this tetrahedron or the supplied vertex is null
    • orientationWrt

      public int orientationWrt(V face, VoronoiCell query)
      Answer 1 if the query point is positively oriented with respect to the face opposite the vertex, -1 if negatively oriented, 0 if the query point is coplanar to the face
      Parameters:
      face -
      query -
      Returns:
    • orientationWrtADB

      public int orientationWrtADB(VoronoiCell query)
      Answer 1 if the query point is positively oriented with respect to the face ADB, -1 if negatively oriented, 0 if the query point is coplanar to the face
      Parameters:
      query -
      Returns:
    • orientationWrtBCA

      public int orientationWrtBCA(VoronoiCell query)
      Answer 1 if the query point is positively oriented with respect to the face BCA, -1 if negatively oriented, 0 if the query point is coplanar to the face
      Parameters:
      query -
      Returns:
    • orientationWrtCBD

      public int orientationWrtCBD(VoronoiCell query)
      Answer 1 if the query point is positively oriented with respect to the face CBD, -1 if negatively oriented, 0 if the query point is coplanar to the face
      Parameters:
      query -
      Returns:
    • orientationWrtDAC

      public int orientationWrtDAC(VoronoiCell query)
      Answer 1 if the query point is positively oriented with respect to the face DAC, -1 if negatively oriented, 0 if the query point is coplanar to the face
      Parameters:
      query -
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • traverse

      public void traverse(Set<Tetrahedron> visited, Set<VoronoiCell> vertices)
      Traverse all the tetradrons in a tetrahedralization, filling in the set of all visited tetrahedron and the vertices defining them

      Parameters:
      visited - - the set of visited tetrahedrons
      vertices - - the set of visited vertices