5

Most iterative algorithms require an initial empty triangle to get the ball rolling. It seems like a commonly used trick is just to make the super triangle very large in comparison with the point set.

But according to "Numerical recipes: the art of scientific computing":

"...if the distance is merely finite (to the boundary points) the constructed triangulation may be not-quite Delaunay. For example its outer boundary could in unusual cases be left slightly concave, with small negative angles on the order of the diameter of the "real" point set divided by the distance to the "fictitious" (boundary) points.

So what options are there for augmenting Cartesian coordinates with points at infinity, without having to convert all the input to a different coordinate system such as homogeneous coordinates? How do these points fit in with the usual geometric predicates CCW and Incircle?

Incircle (a,b,c) Infinity -> False. provided that a,b,c are finite.

But what about when one of a,b,c is a point at infinity? Does the circle become a half-plane and the test then become a CCW check? What if 2 or more points on the circumcircle are infinite? does the circle expand into a full plane causing the test to always yield true? What about CCW? how do you classify a point in relation to a line that has one or more points at infinity?

2 Answers2

1

It is quite easy to implement a Delaunay triangulation by adding a point at infinity. Chose a convention for the infinite vertex (e.g., vertex index -1).

At the beginning, you create an initial finite tetrahedron T0 between 4 non-coplanar points taken from the input pointset, and then create four infinite tetrahedra that connect each face of T0 to the infinite vertex 0 (and do not forget to interconnect them properly along their common infinite faces).

Then you insert each point p, one by one, as usual (Boyer-Watson algo), by (1) computing the tetrahedron T that contains the point p (locate) and (2) finding the conflict zone, as follows:

(1) locate is unmodified: you walk to p from a random finite tetrahedron. During walking, if you arrive in an infinite tetrahedron, then you stop there (this means the point is outside the convex hull of the previously inserted points)

(2) Determining the conflict zone needs a small modification :

  • A point p is in conflict with a finite tetrahedron T if its in its circumscribed sphere (as usual)

  • For an infinite tetrahedron T = (p1, p2, p3, p4), one of p1,p2,p3,p4 is the infinite vertex (for instance p2, then T = (p1, infinite, p3, p4)). To check whether p is in conflict with T, replace the infinite vertex with p, and compute the signed volume of the tetrahedron: signed_volume(p1, p, p3, p4) in our example, if it is positive, then T is in conflict with p. If it is negative then T is not in conflict with p. If p is exactly on the supporting plane of the three finite vertices of T, then T is in conflict with p if T' is in conflict with p, where T' is the tetrahedron adjacent to T along the finite face of T (equivalently, instead of quering T', one may check whether p is in the circumscribed circle of the finite facet of T).

See implementations in:

BrunoLevy
  • 2,495
  • 17
  • 30
  • Can you use a point-in-polygon test when the center of the circumcircle is outside and/or infinite the super triangle. Would that be easier and also guarantee a convex hull? See my answer here:http://stackoverflow.com/questions/30876132/what-is-the-best-initial-shape-for-3d-delaunay-incremental-algorithm – Micromega Jul 14 '15 at 12:08
  • I'm unsure I understood, but I think that here the strategy is different since all the infinite tets are represented explicitly. More details in the tech report by CGAL people (https://hal.inria.fr/inria-00167199/) (I'm using exactly the same strategy as them). – BrunoLevy Jul 14 '15 at 12:19
0

I think you are making life difficult for yourself by trying to define the complete mathematics of geometries that contain points at infinite distance away. This isn't necessary for the purposes of your original problem of calculating the Delaunay triangulation accurately.

I wrote a Delaunay generator in Java a while ago and it is available here: http://open.trickl.com/trickl-graph/index.html

See http://open.trickl.com/trickl-graph/apidocs/index.html and in particular:

    // Check if fourth point is within the circumcircle defined by the first three
   private boolean isWithinCircumcircle(PlanarGraph<V, E> graph, V first,
           V second,
           V third,
           V fourth) {
      // Treat the boundary as if infinitely far away
      Coordinate p = vertexToCoordinate.get(fourth);
      if (PlanarGraphs.isVertexBoundary(graph, first)) {
         return isLeftOf(third, second, p);
      } else if (PlanarGraphs.isVertexBoundary(graph, second)) {
         return isLeftOf(first, third, p);
      } else if (PlanarGraphs.isVertexBoundary(graph, third)) {
         return isLeftOf(second, first, p);
      } else if (PlanarGraphs.isVertexBoundary(graph, fourth)) {
         return false;
      }

      Coordinate a = vertexToCoordinate.get(first);
      Coordinate b = vertexToCoordinate.get(second);
      Coordinate c = vertexToCoordinate.get(third);

      boolean within = (a.x * a.x + a.y * a.y) * getDblOrientedTriangleArea(b, c, p)
              - (b.x * b.x + b.y * b.y) * getDblOrientedTriangleArea(a, c, p)
              + (c.x * c.x + c.y * c.y) * getDblOrientedTriangleArea(a, b, p)
              - (p.x * p.x + p.y * p.y) * getDblOrientedTriangleArea(a, b, c) > 0;

      return within;
   }

Here, the boundary points are explicitly checked for when checking the circumcircle condition, so they can effectively be treated as "infinitely" away. This is much easier than figuring out all the geometrical implications than you describe.

Tim Gee
  • 1,062
  • 7
  • 9
  • Tim, could you please explain what logic you have used to select the boundary points? – chaitanya Jan 12 '12 at 01:30
  • As this isn't an incremental algorithm, the complete list of points is available prior to calculating the boundary. So I first calculate the minX, minY, maxX, maxY of all the points (the rectangular bounds) and then I create a triangle large enough to completely contain that rectangular region using some basic geometry. – Tim Gee Jan 12 '12 at 11:47
  • Please correct if I am wrong, but I think even the complete list of points is provided in an incremental algorithm. I think the points are added one by one probably in a random order in the incremental algorithm. Also, could you please explain the basic geometry in which you calculated the co-ordinates of the 'super-triangle'. I was using the area and perimeter of the rectangle to calculate the base and height of the triangle. Is the right way to proceed? – chaitanya Jan 12 '12 at 22:12
  • See "createBounds" in https://github.com/trickl/trickl-graph/blob/master/src/main/java/com/trickl/graph/generate/DelaunayGraphGenerator.java – Tim Gee Jan 13 '12 at 00:55
  • Thanks for the link Tim. I was trying to import your project as a library but I was having problems with that. I installed m2eclipse to import the Maven projects but I was getting a missing artifact error in the pom.xml file. Could you please tell me how to import your project as a jar file? – chaitanya Jan 16 '12 at 19:39
  • Tim, your logic made sense. You crate an envelope which is essentially a rectangle having width maxX-minX and height maxY-minY. Then you calculate the triangle half width and height and subtract it from the (minx+maxX)/2. the question is how did you arrive at the multipliers 1.51 for width and 1.01 for height? Would any other multiplier do or is there a formula for these. thanks again for your help – chaitanya Jan 16 '12 at 20:01
  • @chaitanya Send me an email (tim@trickl.com) and tomorrow I'll endeavour to send you a jar with all dependencies included. The exact fit for the envelope is 1.5 and 1, the extra 0.01 is just to ensure the envelope is bigger. – Tim Gee Jan 16 '12 at 22:05
  • Thanks Tim. I really appreciate it; though I would have liked to compile the project from Maven [which would have been my first attempt]. – chaitanya Jan 16 '12 at 23:02