Subject: CGAL users discussion list
List archive
- From: Dennis Endt <>
- To:
- Subject: [cgal-discuss] Convex Hull, Delaunay, angle
- Date: Tue, 07 Oct 2008 11:34:36 +0200
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=EpAlIJpnZW0iDUDVpZImGXBT4L6TQX53eL+YCfXoe8IrvOjpxn/XDWnuwyg4x+L6sv iHXvARa1tZshUA/z2+d45YQztyrorWWK/VjKlA2Zhj/TIlzWnzX+2C9mwMT0HeyPtfl5 JN28HmZfaK4HC4CJrC7MaDN/9XQUM38yS6CZI=
Hi,
in the Documentation I found an example for a dynamic computation of a
convex hull with the help of a Delaunay Triangulation.
I followed the example and implement the code:
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Delaunay_triangulation_3<K> Triangulation;
typedef Triangulation::Point tPoint;
typedef Triangulation::Vertex_handle D_Vertex_handle;
After I inserted some Points in my Triangulation Object I started the
output:
list<D_Vertex_handle> vertices; // vector to hold the points of the
convex hull
T.incident_vertices(T.infinite_vertex(), back_inserter(vertices)); //
get the points from Delaunay
It worked fine. So in the last step I would like to remove points in the
middle of two other points, approximately all three points on the line.
Therefore I found the function :
angle( Point 3<Kernel> p,Point 3<Kernel> q,Point 3<Kernel> r)
I tried to implement this with the hope to remove further redudant points:
for(std::list<D_Vertex_handle>::iterator p = vertices.begin(); p !=
vertices.end(); p++)
{
for(std::list<D_Vertex_handle>::iterator q =
vertices.begin(); q!= vertices.end(); q++)
{
for(std::list<D_Vertex_handle>::iterator r =
vertices.begin(); r!= vertices.end(); r++)
{
if(CGAL::angle(*p,*q,*r))
{
T.remove(*q);
}
}
}
}
But now the problem is that the function above needs Point3, but I only
have Vertex_Handles. I didn`t found anything to pass this situation.
Furthermore I would like to know how I can retrieve the value of the
angle of the three points.
In the Docu it says only the function returns OBTUSE, RIGHT or ACUTE
depending on the angle formed by the three points
Can anyone help me plz? :-)
Best
Dennis
- [cgal-discuss] Need help to configure Geomview, Samay Kumar, 10/06/2008
- [cgal-discuss] Convex Hull, Delaunay, angle, Dennis Endt, 10/07/2008
Archive powered by MHonArc 2.6.16.