简体   繁体   中英

How to get the face id from face_handle?

I have .off file with vertices and faces. I am using Triangulation_2 class's locate function to locate which triangle is containing a given point. I can get the face_handle of the triangle. But I also want to know the id of the face_handle. What is the way to get the ID (index) of the face that the point is inside?

The best way to do it is to use the class Triangulation_face_base_with_info_2 to store an index inside the faces. Once the triangulation is built, simply set the indices by hand and then you'll be able to use them during the locate queries.

See this example that similarly adds a color to each face.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM