Delaunay triangulation from convex hull - computational-geometry

I need to write some codes on computational geometry and parallelize them using openMP.So far, I have finished convex hull and closest pair of points.I need to write the delaunay triangulation divide and conquer code.But I dont have much time.I read somewhere that delaunay triangulation can be easily implemented if the convex hull can be calculated.So if anyone can provide me the serial code for DT or atleast let me know how i could generate the delaunay triangulation from convex hull, i could write the code and parallelize it as soon as possible.

I read somewhere that delaunay triangulation can be easily implemented if the convex hull can be calculated.
This is true, but the precise statement is that the 2D Delaunay triangulation can be easily constructed if a 3D convex hull implementation is available. Knowing the 2D hull does not help much with constructing the Delaunay triangulation (DT), besides giving you a few edges of the DT (each hull edge is an edge of the DT).
Assuming you have not implemented the 3D hull (which is quite tricky), then you need to attack
the Delaunay triangulation separately.

QHull is pretty much the standard library many people use: http://www.qhull.org/html/qhull.htm
Perhaps you can use it as a reference implementation, if you really want to reimplement this.

Related

Computing the upper convex hull in 3d using Qhull

I am trying to compute the upper convex hull of a cloud of point in 3D using Qhull. I do not know if there is a simple way to do it.
I've looked into several options of the modules ConvexHull and Delaunay, 'Qu' furthest site, but i do not think it does what I want, as it seems to be a way of computing the Delaunay triangulation using lower/upper convex hulls.
Another way of engineering a solution could be for each simplice of the convex hull to compute the normal and the center point of the surface, as to introduce a new point close to the center following a translation upon the normal.
Having added this point I could just compute the convex hull of the original ensemble plus this point and see if this point is interior to the hull or not.
I could then deduce if the simplice belongs to the upper and/or the lower hull.

Get the polygon created by moving a polygon

I don't know if the process has a specific name. I want to get the polygon which is created by translating a polygon. Is there an algorithm for this. For example:
.
Convex hull works for convex polygons but I want a general solution. Also I would be happy to hear if there is a way to get the polygon created by rotating.
It appears you are looking for the Minkowski sum of your polygon and the line segment describing your movement.
The CGAL library package 2D Minkowski Sums can compute them for instance.
Given the explanation you gave in comments, the straightforward approach is this:
Let v be a vector describing the linear movement
For each edge (p,q) in the polygon
construct quadrilateral (p, q, q+v, p+v)
Compute the union of all the quadrilaterals plus the original polygon
Computing polygon unions is a well-studied problem with efficient algorithms.

Algorithm for the reduction of a Triangulation

I've computed a triangulation of a region, which boundaries are described by a polygon. But the triangulation is computed for the convex hull, bigger than the region.
Some of the triangles in the resulting set must be discarded. Dou you know about an algorithm for this operation?
I would combine this (triangulation of the convex hull) with another algorithm which would check if a given point is inside the polygon or not. Then, for each resulting triangle, I would check if it's median point is inside the polygon.
If you can use a 3rd party library, you can use CGAL and the following example will do what you want (including the triangulation).
You can try alpha shapes. Its delaunay triangulation without edges exceeding alpha.

Robot Motion Planning using Delaunay and Dijkstra

I am trying to develop an algorithm based on delaunay triangulation, fermat point, improved dijkstra's algorithm to implement robot motion planning. Currently I have covered delaunay triangulation and fermat point. I have started my work with Dijkstra's using Fibonacci heap. Currently I am working on polygonal shaped objects. Suppose if I want to include real life curved obstacles, how can I do so? Is there a way to approximate curvy obstacles to polygonal obstacles? Also if a project based on dynamically changing surroundings is to be incorporated, what are the basic ideas required, like what should be covered?
You can aproximate a 2d curve, or reduce the number of vertices of a poly line, with the Douglas-Peucker Algorithm.

How to convert a polygon to a set on non-overlapping triangles?

I have a coordinate set of 2D points that form a closed polygon. I need to generate a set of 2D triangles that distribute the polygon completely.
There are no constrains as such except that the triangles should fill the area of polygon completely. It would be even more helpful if it is a standard algorithm I could implement.
The best way to triangulate general polygons is to compute the constrained Delaunay triangulation - this is a standard Delaunay triangulation of the polygon vertices with additional constraints imposed to ensure that the polygon edges appear in the triangulation explicitly. This type of approach can handle any type of polygon - convex, concave, polygons with holes, etc.
Delaunay triangulations are those that maximise the minimum angle in the mesh, meaning that such a triangulation is optimal in terms of element shape quality.
Coding a constrained Delaunay triangulation algorithm is a tricky task, but a number of good libraries exist, specifically CGAL and Triangle. Both these libraries implement an (optimally) efficient O(n*log(n)) algorithm.
As mentioned above, Delaunay triangulation is a rather complicated algorithm for this task. If you accept O(n^2) running time, you may try Ear Clipping algorithm which is much more easier to understand and to code. The basic idea is the following. Every polygon with >= 4 vertexes and no holes (i.e. its border is a single polyline without self-intersections and self-tangencies) has at least one "ear". An ear is a three consecutive vertexes such that the triangle built on them lies inside the polygon and contains no other points of the polygon inside. If you "cut an ear" (add a triangle to the answer and replace remove the middle point of these three points), you reduce the task to a polygon with less vertexes, and so on. Ears may be trivially (by definition) found in O(n^2) resulting in a O(n^3) triangulation algorithm. There is O(n) ear finding algorithm, and, though it is not very complicated, it is rather long to be described in a couple of phrases.
Furthermore, if you need faster algorithms, you should look something about monotone polygons triangulation and splitting a polygon into monotone ones. There even exists a linear-time triangulation algorithm, but its just as complicated as Delaunay triangulation is.
You may consider Wikipedia article and see an small overview of existing methods there.
If you don't require that the vertices of the triangles be vertices of the polygon, try a triangulation based on a trapezoidal decomposition, as in Fast Polygon Triangulation based on Seidel's Algorithm.

Resources