Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Checking for a vertex in a Polyhedron

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Checking for a vertex in a Polyhedron


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Checking for a vertex in a Polyhedron
  • Date: Mon, 07 Feb 2011 08:45:27 +0100

vanimurarka wrote:
Hi,

Is there a way I can query a polyhedron model to check whether a point
exists as a vertex in the polyhedron?
nothing specific in the class.


I looked into the documentation and could not seem to find any direct query.
I do not really want to iterate over the whole set of vertices because this
query needs to be done repeatedly in the algorithm I am implementing.
If there is no direct query, what are the suggestions for the shortest /
most efficient way of obtaining this information?

At present, the best I can think of is to maintain a separate HashTable of
the vertices added to the polyhedron, where the x-y-z co-ordinate of the
vertex is concatinated as a string to serve as the key of the HashTable.
Then when I have a new point, I can use its co-ordinate values to query the
HashTable. However, I might possibly run into accuracy issues.

As a geometric method, using a Kd_tree and the search member function
with a small epsilon (and an equality test for all candidates) might be a solution.
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Spatial_searching_ref/Class_Kd_tree.html

S.

Thanks

Vani




Archive powered by MHonArc 2.6.16.

Top of Page