Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] using CGAL::squared_radius to calculate

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] using CGAL::squared_radius to calculate


Chronological Thread 
  • From: Query Cgal <>
  • To:
  • Subject: Re: [cgal-discuss] using CGAL::squared_radius to calculate
  • Date: Sat, 21 Feb 2009 21:57:38 -0800 (PST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.hk; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=IBszDh7c8RbXQZGKAt8k0VH7qckVEFuCof1/XxT/min82CwZb1VJMG767aOGmFHkFDRBv5ZdsK7UXxICwoCxWmSkejU3H2dVe7eOEMRNE5BRCrJIdUG3MEIIkDmRzIpbIC1vzwzPjHpFeZxTmc/EGCUHUG/2+3Li5psCJeZO9nA=;

Thank you very much for your help.
My program run much faster than before after I have removed all the cout code which intends to show the status of the program. :-)

--- 2009年2月21日 星期六,Ariel Baez <> 寫道﹕
寄件人: Ariel Baez <>
主題: Re: [cgal-discuss] using CGAL::squared_radius to calculate
收件人:
日期: 2009 2 21 星期六 下午 11:42

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.



Yahoo!香港提供網上安全攻略,教你如何防範黑客!了解更多



Yahoo!香港提供網上安全攻略,教你如何防範黑客!了解更多


Archive powered by MHonArc 2.6.16.

Top of Page