0

I chose to use CGAL to attain a 3-D Delaunay triangulation of a terrain file (.xyz). The triangulation is complete but now I need a method to extract contours at desired z-height values. The method I am considering is to get an AABB tree from the facets of the triangulation, and then take an intersection of a plane (at desired z-height value) against the tree.

The issues:

  1. I do not know how to take the triangulation facets and get an AABB tree from them. I've read the documentation and other forums, but the process is still not clear.

  2. When the intersection of the plane and tree returns, I suspect the intersection yields a set of segments, I do need these segments to be ordered form a closed set. Can the ordering be enforced or determined?

  3. How to detect that there are multiple closed sets, for example, if the plane intersection cuts two separate/individual mountain tops, I need two individual contours around the mountain peaks. Can this be identified via the returned intersection segments?

1 Answers1

1

You can convert the triangulation into a Surface_mesh and use the function Polygon_mesh_slicer to extract iso-contours.

sloriot
  • 6,070
  • 18
  • 27
  • The quickest way is indeed to iterator over finite faces, having first added the triangulation vertices into the Surface_mesh, and having set a mapping DT vertices -> SM vertices. (If you have indices in the triangulation vertices, it is even simpler). – sloriot Oct 11 '16 at 07:15
  • If you can share a minimal example I can have a look (I'm the author of the slicer) as it should be pretty fast and output should be correct. – sloriot Oct 14 '16 at 07:50
  • I don't know what you did but the code put in the output iterator one `std::vector` per polyline. The only reason I see you would have only segments is that you have a triangle soup (no connections between triangles) and not a mesh. – sloriot Oct 21 '16 at 06:27
  • The template parameter of `Triangulation_vertex_base_with_info_2` should be `Gt`. How did you create the Surface_mesh from the triangulation? – sloriot Oct 25 '16 at 07:19
  • You should start by adding all vertices, create a mapping between T2::Vertex_handle and SM::vertex_descriptor so that when you create a face, you can reuse the vertices that you added. – sloriot Oct 26 '16 at 07:43
  • _ I have several questions regardin a slicer: in company I work we have our own version of aabbtree, i found the intesection triangles pairs and segments. now i need to create boundary. i`ll be glad to advise – YAKOVM Aug 20 '20 at 12:46