Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] AABB tree and 3D mesh

Subject: CGAL users discussion list

List archive

[cgal-discuss] AABB tree and 3D mesh


Chronological Thread 
  • From:
  • To:
  • Subject: [cgal-discuss] AABB tree and 3D mesh
  • Date: Fri, 28 May 2010 15:15:38 +0200 (MEST)
  • Importance: Normal

Hi,
I had to compute the intersections points of a ray and a 3D object. So I
combined a 3D mesh generation procedure with an AABB tree. I suppose, for
example, to use the mesh generated in
examples/Mesh_3/mesh_implicit_sphere.cpp against a query ray which has the
origin of the sphere as source and crosses a point on the surface of the
sphere.
As I need to consider intersections with both triangles on the volume and
on the surface I chose an iterator on triangulation facets using C3T3 and
then I checked whether triangles belong to the complex.
......
struct K: public CGAL::Exact_predicates_inexact_constructions_kernel {};
typedef K::Triangle_3 Triangle;
typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr> C3t3;
typedef C3t3::Triangulation Tr;
typedef Tr::Finite_facets_iterator Finite_facets_iterator;

std::list<Triangle> triangles;
for(Finite_facets_iterator fi=c3t3.triangulation().finite_facets_begin();
fi != c3t3.triangulation().finite_facets_end(); fi++) {
Cell_handle cell = fi->first;
int opposite_vertex_index = fi->second;
if(c3t3.is_in_complex(cell)) {
Triangle
t=c3t3.triangulation().triangle(cell,opposite_vertex_index);
triangles.push_back(t);
}
else if (c3t3.is_in_complex(*fi))
{
Triangle t=c3t3.triangulation().triangle(*fi);
triangles.push_back(t);
}

}

In this way I would select all the triangles (volume/surface) representing
the 3D object as primitives to perform intersection queries.
Actually I'm wondering about some features of the outcomes of the
intersection procedure on this set of triangles:
1) On average only 30 intersection points for about 30000 triangles. How
to establish whether the number of intersection is "reasonable"?
2) Never multiple intersections. I guess that It is unlikely to cross a
vertex or an edge, anyway possible.
3) Tuning radius bound of cells and boundary triangles in order to obtain
a uniform mesh doesn't assure uniform spacing for the intersection points.

Thanks in advance for any comment on this topic!













  • [cgal-discuss] AABB tree and 3D mesh, cecilia, 05/28/2010

Archive powered by MHonArc 2.6.16.

Top of Page