Triangulation 3D algorithm - c++

I have thousands of polygon on 3D space which contains more than 3 vertex. I want partition each polygon into a set of triangles. I have been looking all over the internet and I can not find any algorithm on 3D that does that. I have found many algorithms working on 2D like ear clipping and Delaunay triangulation. But I can not find any algorithm for 3D.
I saw many same questions on this site which answered with "use the Delaunay triangulation algorithm". But I have seen that this algorithm is for 2D:
http://www.geom.uiuc.edu/~samuelp/del_project.html
Implement an algorithm for finding the constrained Delaunay triangulation of a given point set in two dimensions.
What 3D Triangulation algorithm can I use?
I am using OpenGL with C++.

You can use the GLUTesselator:
http://www.glprogramming.com/red/chapter11.html
Also note that a 3D polygon will have many faces which can be translated onto an axis aligned 2D plane, triangulated, and then the results translated back into the plane defined by the face.

You can use a delaunay triangulation but with tetrahedons. Basically use Bowyer Watson with circumspheres:http://blog.mmacklin.com/tag/meshing/.

Related

3d surface mesh triangulation

Does anyone know an algorithm to generate a 3d surface mesh given a set of vertices? My project requires that we construct an irregular 3d object in OpenGL and I am having trouble finding out how to do this using triangulation.
You better with a library like cgal. It implements the boywer-watson algorithm but with tetrahedrons. It's a very fast incremental triangulation. Then find the convex hull and remove edges exceeding alpha.

Polygon Offset/ Minkowski sum with a sphere algorithm

I am looking for a accurate polygon offset algorithm for 3D polygons, convex and non convex. This can also be achieved with Minkowski sum with a sphere. I know CGAL provide a minkowski package.
However, is there an easy algorithm that I can implement to achieve this task of polygon offse in 3D.
Thanks.
Cheers,
CB
There are easy-ish approaches for offsetting convex polyhedra -- you just move each polygon along its normal, convert edges into cylindrical arcs, and vertices into spherical sectors. For concave geometry, though, this will produce intersecting and degenerate faces. If all you want to do is render then that's okay... but if you intend to do anything interesting with the offset geometry, you really need the big guns provided by things like CGAL.

Alpha shapes from weighted Delaunay Triangulation

I am looking for an algorithm to solve alpha shapes from weighted delaunay triangulation (assuming we have weighted DT) in 2D and 3D. I've looked at a few online links that provide complicated explanations. It'll be great if i can get pseudo code of the algorithm with good explanation.
You can try to use CGAL that provides both 3D and 2D weighted alpha-shapes.
Examples in 3D are available here and here.
The 2D case is similar.
Alpha shapes is alpha value and every edges exceeding alpha. Hence you can remove those edges. I don't think it needs dt. a weighted dt.

Polygon Partitioning vs Triangulation

I recently asked this question about how to cut down a concave polygon to convex ones, and I was suggested to do Triangulation or Polygon Partitioning.
The library I'm using (SFML\Box2D) only takes convex shapes.
This is what I want to know:
Is Polygon Partitioning, or Triangulation of Polygons faster?
How does Polygon Partitioning work/ How do you do it?
Don't forget Triangulation doesn't require convex shapes to be made either...
Not a full answer to your question, but if you have a general polygon (concave, convex, whatever) and you are looking to triangulate it (for subsequent openGL style rendering perhaps) you could look into "constrained Delaunay triangulation" packages. One such example is the Triangle package, which is reputed to be fast and robust.
As I understand it, the algorithms used in Triangle exhibit O(nlogn) runtime complexity.
Polygon partitioning splits your polygon into convex polygons.
Triangulation splits it into triangles.
As far as I understand, partitioning into triangles requires that you first perform polygon partitioning, since partitioning convex polygon into triangles is relatively trivial.
Splitting polyon into convex polygons is the hard part.
I have written a program that does both for a class and if you want I can dig it up.
Here's my code:
https://github.com/meshko/triangulator/tree/master/som
I haven't touched in 10 years so beware of.

Polyhedron from the plane equations

I have a few planes (3-10 of them) in 3d defined by their equations (three coefficients and the offset). These planes are the edges of a convex polyhedron. I need to draw that polyhedron. How can I do that? What software/libraries/algorithms can I use? I work in Linux and I'm usually using C or C++.
Every plane pair intersects in a line on both planes. Each plane then contains a set of lines that intersect in points, all of those are the edge points of your polyhedron you'll have to connect in a convex way.
With some math/geometry skills, you should be able to solve this, but using a library (f.e. CGAL) of course simplifies it and prevent you from reinventing the wheel.