Calculate the distance between two triangulated surface meshes by CGAL - cgal

We need a tool to compute the distance between two triangulated surface meshes. And we are only allowed to use the CGAL to solve the problem.
I only found the API computing the distance from a point to a surface in AABB tree package, and some relevant APIs in Surface_mesh_shortest_path package. But I still can't fix my problem. Is there any tool in CGAL could fix my problem? Thanks!

You posted that as an issue and we converted it into a discussion, and told you that there is the Hausdorff distance function in the Polygon Mesh Processing package. You did not react, so what is wrong about this answer?

Related

Writing CGAL Efficient Ransac detected planes to file

I've been successfully testing CGAL Efficient RANSAC using this provided example to detect planes in a point cloud. The only piece missing from the CGAL Efficient RANSAC examples is a way to write the detected planes into a mesh (something like what polyfit offers at the end of this example)
I've noted that I can use the planes() method from Efficient_RANSAC to get an iterator of Plane but I'm a bit lost after that. Do I need to read all points from each plane and try and manually create a mesh from it ?
Thanks in advance for any help

Inverted faces in surface mesh produced by Polygonal Surface Reconstruction

I'm trying to use Polygonal Surface Reconstruction with building point cloud to create simplified building models.
I did first tests with this CGAL code example and got first promising results.
As an example, I used this point cloud with vertex normals correctly oriented and got the following result from PSR. Some faces are clearly inverted (dark faces with normals pointing inside the watertight mesh and therefore not visible).
I was wondering if there a way to fix this face orientation error. I've noticed orientation methods on Polygon mesh but I don't really know to apply them to the resulting PSR surface mesh. As far as logic is concerned making normal point outwards should not be too complicated I guess.
Thanks in advance for any help
You can use the function reverse_face_orientations in the Polygon mesh processing package.
Note that this package has several functions that can help you to correct/modify your mesh.

Frontier in a Delaunay Triangulation

I´m working in a Delaunay triangulation. I have my own frontier that is not the convex hull polygon. I want to use the my own frontier, instead of use the cgal convex hull. I haven´t found in the documentation how to do that. I suppouse that this should be done in the insertion of a vertex or a edge but havent found a function to do that. Any help will be appreciated.
By imposing the outline you are changing the nature of the problem and turn it to a so-called constrained Delaunay triangulation. Check the cgal documentation about it.

Triangulate a surface with vtk from points AND normals

I have a set of points in 3D that lie on a surface and I also have the normals at every point.
I would like to generate a surface triangulation with this information. In addition I could tell the algorithm to use what points lie on the boundary if that is needed.
So, I have quite a bit of information:
* points
* normals
* boundary
How do I triangulate a surface with this information using vtk?
A surface reconstruction algorithm is like using a bomb for this problem since I have all this information that I would like to use. This information comes from a simulation so I know the surface exists and that is quite smooth.
I would like the answer to be cast in terms of either what vtk function to use and if available (and that would be great) examples using this function.
Thank you so much in advance.
You can use the vtkSurfaceReconstruction filter to create a surface from a set of 3D points.
You could try the point cloud library
Point Cloud Library
Just the 3D points would be good enough. Since you know that your surface is smooth, you can perform a Delaunay triangulation of the points (vtkDelaunay3D) and apply a subdivision filter for smoothening (vtkButterflySubdivisionFilter).
Delaunay3D triangulation

tetrahedrizing a mesh

I am looking for an algorithm that receives a 3d surface mesh (i.e comprised of 3d triangles that are a discretization of some manifold) and generates tetrahedra inside the mesh's volume.
i.e, I want the 3d equivalent to this 2d problem: given a closed curve, triangulate it's interior.
I am sorry if this is unclear, it's the best way I could think of explaining it.
For the 2d case there's Triangle. For a 3d case I could find none.
pygalmesh (a project of mine based on CGAL) can do just that.
pygalmesh-volume-from-surface elephant.vtu out.vtk --cell-size 1.0 --odt
https://github.com/nschloe/pygalmesh/#volume-meshes-from-surface-meshes
I found GRUMMP which seems to answer all the needs mentioned in the question, and more...
I haven't had any experience using GRUMMP, but as far as a 3D version of triangle there is tetgen. If you know the triangle switches it is built to resemble it. It also has fairly decent documentation and a python wrapper for it and triangle.
http://wias-berlin.de/software/tetgen/
http://mathema.tician.de/software/meshpy/