Module imagingbook.common
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 TypeMethodDescriptionstatic DelaunayTriangulationfrom(Collection<? extends Pnt2d> points) Performs Delaunay triangulation on the specified points.static DelaunayTriangulationfrom(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 ofTriangleinstances 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.intsize()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 ofTriangleinstances 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
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
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 rectanglexmax- maximum x-coordinate of the bounding rectangleymin- minimum y-coordinate of the bounding rectangleymax- maximum y-coordinate of the bounding rectangle- Returns:
- a triangle as an array of 3 points
-
makeOuterTriangle
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 rectangleheight- the height of the bounding rectangle- Returns:
- a triangle as an array of 3 points
-
from
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
DelaunayTriangulationinstance
-
from
Performs Delaunay triangulation on the specified points with (optional) random insertion order.- Parameters:
points- the point set to be triangulatedshuffle- settrueto randomly shuffle the input points- Returns:
- a
DelaunayTriangulationinstance
-