Subject: CGAL users discussion list
List archive
- From: Ariel Baez <>
- To:
- Subject: Re: [cgal-discuss] using CGAL::squared_radius to calculate
- Date: Sat, 21 Feb 2009 18:42:32 -0500
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=lMUjsShz6PxQv+OU5L2ifJKBpQX9oZFnQQjpzNsX5n9SV7AyW5ruhNlx15lVcBPrJi ds3JMQyw51mYAzxylJnw3sAenVXZS79ZDWVtRxnTByNEHarj1MD6Ugj59YEz8b0NmH2f evQrmWz98mj8w3ZyYBDCjkVRbSax3Jf0FLhGI=
Hello,
I would remove the cout code, It doesn't seem to serve any purpose other than a status indicator. You know the running time to be 1hr or so. Check the running time without this.
Hope this helps.
AB
On Sat, Feb 21, 2009 at 4:40 AM, Query Cgal <> wrote:
Hi.
I have been trying to calculate the circumradius of every triangle inside a 3D triagulation.
I am using Visual Studio C++ 2005, CGAL3.3.1 with boost C++ library 1.35.0
And I have 1.00GB RAM in my PC.
Currently, I attempted to access the triangles of the triangulation through the Finite_facets_iterator provided in CGAL in the following way.
void check_circumradius(list<Finite_facets_iterator>& selected_facet)
{
double fifth_nearest_1;
double fifth_nearest_2;
double fifth_nearest_3;
double max_fifth_nearest;
double circumradius = 0;
Finite_facets_iterator start = Dt.finite_facets_begin();
Finite_facets_iterator end = Dt.finite_facets_end();
Finite_facets_iterator curr;
Vertex_handle v1;
Vertex_handle v2;
Vertex_handle v3;
Triangle triangle;
for(curr = start; curr != end; ++curr)
{
triangle = Dt.triangle(*curr);
cout << ++i << "check circumradius" << endl;
v1 = curr -> first -> vertex(0);
v2 = curr -> first -> vertex(1);
v3 = curr -> first -> vertex(3);
fifth_nearest_1 = (v1 -> fifth_nearest_dist) * 3;
fifth_nearest_2 = (v2 -> fifth_nearest_dist) * 3;
fifth_nearest_3 = (v3 -> fifth_nearest_dist) * 3;
max_fifth_nearest = max_of_three(fifth_nearest_1, fifth_nearest_2, fifth_nearest_3);
circumradius = CGAL::sqrt(squared_radius(triangle.vertex(0),
triangle.vertex(1),
triangle.vertex(2)));
if (max_fifth_nearest >= circumradius)
{
selected_facet.push_back(curr);
}
}
}
By using t.number_of_facets(), I found out that there are more than 4000000 facets to process. And in my current code, I need approximately 1 hour 6 minutes to process all of the facets.
May I ask if this running time is normal in CGAL?
Is it I have misused the features of CGAL in some way?
Thank you for your help.
- [cgal-discuss] using CGAL::squared_radius to calculate circumradius of triangle, Query Cgal, 02/21/2009
- Re: [cgal-discuss] using CGAL::squared_radius to calculate, Ariel Baez, 02/22/2009
- Re: [cgal-discuss] using CGAL::squared_radius to calculate, Query Cgal, 02/22/2009
- Re: [cgal-discuss] using CGAL::squared_radius to calculate, Ariel Baez, 02/22/2009
Archive powered by MHonArc 2.6.16.