Subject: CGAL users discussion list
List archive
- From: Burak ER <>
- To:
- Subject: Re: [cgal-discuss] "Getting list of each interface facet between tetrahedrons"
- Date: Tue, 15 Oct 2013 23:35:28 +0300
Your solution seems to get all the facets either they are interface or
a surface facets. How can I determine the surface facets? A zero
neighbor value indicates it as a surface facet?
Thank you in advance.
Sal, 2013-10-15 tarihinde 16:32 +0200 saatinde, Laurent Rineau
(CGAL/GeometryFactory) yazdı:
> Le lundi 14 octobre 2013 23:50:44 Burak ER a écrit :
>
> > Dear Cgal mail list subscribers,
>
> >
>
> > I am searching for a way to get interface facets between all the
>
> > tetrahedras on a mesh. Therefore, every facet should have a self
> index
>
> > and the tetrahedrons indices which it belongs to. For example;
>
> >
>
> > struct facet{
>
> > int id;
>
> > int tetrahedron_id1;//first tetrahedron
>
> > int tetrahedron_id2;//second tetrahedron
>
> > }
>
> >
>
> > What is the best(fastest) way to solve this problem with cgal 3d
>
> > meshing?
>
>
>
> You can use the template CGAL::Triangulation_cell_base_with_info_3 to
> add extra member fields to the cells of CGAL 3D triangulations.
>
>
>
> For example:
>
> struct Cell_info {
>
> int id;
>
> };
>
>
>
> Then, on a 3D triangulation, use the facets iterators:
>
>
>
> std::vector<facet> all_facets; // container of 'facet' struct
>
> int facet_id = 0;
>
>
>
> for(Tr::Finite_facets_iterator
>
> fit = tr.finite_facets_begin(),
>
> end = tr.finite_facets_end(); fit !=end; ++fit)
>
> {
>
> Tr::Cell_handle cell = fit->first;
>
> int index = fit->second;
>
>
>
> Tr::Cell_handle other_cell = cell->neighbor(index);
>
>
>
> // Then here you can use cell->info().id and other_cell->info().id
>
> // to fill your container of facets.
>
> facet new_facet = { facet_id++, cell->info().id,
> other_cell->info().id };
>
> all_facets.push_back(new_facet);
>
> }
>
>
>
> In my opinion, you should use 'std::size_t' instead of 'int' as "id
> type".
>
>
>
> --
>
> Laurent Rineau, PhD
>
> R&D Engineer at GeometryFactory http://www.geometryfactory.com/
>
> Release Manager of the CGAL Project http://www.cgal.org/
>
>
>
--
Burak ER
Research Assistant
Faculty of Natural Sciences & Engineering
Bursa Technical University
mailto:
https://github.com/burak-er
- [cgal-discuss] "Getting list of each interface facet between tetrahedrons", Burak ER, 10/14/2013
- Re: [cgal-discuss] "Getting list of each interface facet between tetrahedrons", Laurent Rineau (CGAL/GeometryFactory), 10/15/2013
- Re: [cgal-discuss] "Getting list of each interface facet between tetrahedrons", Burak ER, 10/15/2013
- Re: [cgal-discuss] "Getting list of each interface facet between tetrahedrons", Laurent Rineau (CGAL/GeometryFactory), 10/16/2013
- Re: [cgal-discuss] "Getting list of each interface facet between tetrahedrons", Burak ER, 10/15/2013
- Re: [cgal-discuss] "Getting list of each interface facet between tetrahedrons", Laurent Rineau (CGAL/GeometryFactory), 10/15/2013
Archive powered by MHonArc 2.6.18.