Interface DelaunayTriangulation

All Known Implementing Classes:
TriangulationGuibas

public interface DelaunayTriangulation

Interface specification for implementations of Delaunay triangulations. See TriangulationGuibas for a concrete implementation.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    from(Collection<? extends Pnt2d> points)
    Performs Delaunay triangulation on the specified points.
    from(Collection<? extends Pnt2d> points, boolean shuffle)
    Performs Delaunay triangulation on the specified points with (optional) random insertion order.
    Returns a list of 2D vertices contained in this triangulation.
    Returns a list of Triangle instances contained in this triangulation.
    static Pnt2d[]
    makeOuterTriangle(double width, double height)
    Creates a 2D triangle that is sufficiently large to be used as an outer triangle for the Delaunay triangulation of points inside the given bounding rectangle, anchored at (0,0).
    static Pnt2d[]
    makeOuterTriangle(double xmin, double xmax, double ymin, double ymax)
    Creates a 2D triangle that is sufficiently large to be used as an outer triangle for the Delaunay triangulation of points inside the given bounding rectangle.
    static Pnt2d[]
    makeOuterTriangle(Collection<? extends Pnt2d> points)
    Creates a 2D triangle that is sufficiently large to be used as an outer triangle for the Delaunay triangulation of the given point set.
    int
    Returns the number of triangles in this triangulation.
  • Method Details

    • size

      int size()
      Returns the number of triangles in this triangulation.
      Returns:
      the number of triangles
    • getTriangles

      Returns a list of Triangle instances contained in this triangulation. The list does not contain the initial outer triangle.
      Returns:
      a list of triangles
    • getPoints

      Returns a list of 2D vertices contained in this triangulation. The list does not contain the vertices of the initial (outer) triangle.
      Returns:
      a list of points
    • makeOuterTriangle

      static Pnt2d[] makeOuterTriangle(Collection<? extends Pnt2d> points)
      Creates a 2D triangle that is sufficiently large to be used as an outer triangle for the Delaunay triangulation of the given point set.
      Parameters:
      points - the 2D point set
      Returns:
      a triangle as an array of 3 points
    • makeOuterTriangle

      static Pnt2d[] makeOuterTriangle(double xmin, double xmax, double ymin, double ymax)
      Creates a 2D triangle that is sufficiently large to be used as an outer triangle for the Delaunay triangulation of points inside the given bounding rectangle.
      Parameters:
      xmin - minimum x-coordinate of the bounding rectangle
      xmax - maximum x-coordinate of the bounding rectangle
      ymin - minimum y-coordinate of the bounding rectangle
      ymax - maximum y-coordinate of the bounding rectangle
      Returns:
      a triangle as an array of 3 points
    • makeOuterTriangle

      static Pnt2d[] makeOuterTriangle(double width, double height)
      Creates a 2D triangle that is sufficiently large to be used as an outer triangle for the Delaunay triangulation of points inside the given bounding rectangle, anchored at (0,0).
      Parameters:
      width - the width of the bounding rectangle
      height - the height of the bounding rectangle
      Returns:
      a triangle as an array of 3 points
    • from

      static DelaunayTriangulation from(Collection<? extends Pnt2d> points)
      Performs Delaunay triangulation on the specified points. Supplied points are inserted without shuffling, i.e., in their original order.
      Parameters:
      points - the point set to be triangulated
      Returns:
      a DelaunayTriangulation instance
    • from

      static DelaunayTriangulation from(Collection<? extends Pnt2d> points, boolean shuffle)
      Performs Delaunay triangulation on the specified points with (optional) random insertion order.
      Parameters:
      points - the point set to be triangulated
      shuffle - set true to randomly shuffle the input points
      Returns:
      a DelaunayTriangulation instance