Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] using CGAL::squared_radius to calculate circumradius of triangle

Subject: CGAL users discussion list

List archive

[cgal-discuss] using CGAL::squared_radius to calculate circumradius of triangle


Chronological Thread 
  • From: Query Cgal <>
  • To:
  • Subject: [cgal-discuss] using CGAL::squared_radius to calculate circumradius of triangle
  • Date: Sat, 21 Feb 2009 01:40:34 -0800 (PST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.hk; h=Message-ID:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=HU7jPeKgQgg6gqG44V00C72FbWvvvzaojZl9hVuoHj9fwttBEZIMpkY6mjTcCnBvwVUWa5xSzHIL83mOsCzlcEys9mWC9YoAPantPL7aHD2LjJm1V9xq/KqCrfw4fgMrvrQWt6fn37dimCNFcZug6zt0FAmbz7lrPkZkx+Dqyt0=;

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!香港提供網上安全攻略,教你如何防範黑客!了解更多


Archive powered by MHonArc 2.6.16.

Top of Page