Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] 3D meshing - Subdomain index of a cell and it's mirror

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] 3D meshing - Subdomain index of a cell and it's mirror


Chronological Thread 
  • From: Mariette Yvinec <>
  • To:
  • Subject: Re: [cgal-discuss] 3D meshing - Subdomain index of a cell and it's mirror
  • Date: Thu, 06 May 2010 10:23:49 +0200

We add some discussions here about that.
In fact, what happens in  the meshing  of polyhedral_domain
is the following:
- when you asked if a facet is on the surface, you actually
test if there is any intersection between the dual segment of this facet
and the input polyhedral surface
- when you compare the sub_domain index of  the two cells incident
 to a given facet, you  get the same index if the dual segment
od the facets intersects twice (or any even number of time)
the boundary surface of this subdomain.

This explain while the first test can tell that a facet is on the surface
while its two incident cells belong to the same subdomain.
Such a behavior especially happens when the input polyhedral surfaces has very close
faces that the mesher has not  resolved in its actual  state of refinement.
In particular, in the case in the model
elephant.off, this may happens
because the input triangulated surface of this model
is self intersecting.

I hope this helps,
Mariette

Ramin H wrote:
Recently most of my questions get ignored before a resolution is found. Are my questions irrelevant?

On Wed, May 5, 2010 at 10:16 AM, Ramin H <> wrote:
I am attaching a slightly modified version of mesh_polyhedral_domain.cpp  and input.off (the elephant that comes with the CGAL examples).

Can you please compile and the .cpp file and run it against the input.off and see if you get any output such as:
Cell and it's mirror have equal subdomain_index: 0

If yes, then why do you think this is happening? How can we fix this?

Thank you for your time.
-Ramin



On Tue, May 4, 2010 at 11:30 AM, Ramin H <> wrote:
Laurent,

Do you get the same results on your machine for the cell and it's mirror if you loop over facets of the C3T3 when you mesh the polyhedral domain I provided?

Thanks,
-Ramin



On Tue, May 4, 2010 at 9:11 AM, Ramin H <> wrote:
I wanted to add that I have extended the Mesher_3 by adding one member function:

template<class C3T3, class MC, class MD>
void
Mesher_3<C3T3,MC,MD>::refine_mesh_one_step()
{
  if ( ! cells_mesher_.is_algorithm_done() )
  {
    cells_mesher_.one_step(cells_visitor_);
  }
}

And call this function at each step to track the mesh refinement and visualize each step. I hope this does not have anything to do with this problem.

-Ramin


On Tue, May 4, 2010 at 8:37 AM, Ramin H <> wrote:
Here are the typedef's

   typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
    typedef CGAL::Mesh_3::Robust_intersection_traits_3<K> Geom_traits;
    typedef CGAL::Polyhedron_3<Geom_traits> Polyhedron;
    typedef CGAL::Polyhedral_mesh_domain_3<Polyhedron, Geom_traits> Mesh_domain;
    // Triangulation
    typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr;
    typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr> C3t3;

I read the Polyhedron from an .off file. This polyhedron was created by performing Boolean operation on a few other polyhedrons. If the input in consistent, then the problem is in the code.


On Tue, May 4, 2010 at 7:57 AM, Laurent Rineau (GeometryFactory) <> wrote:
On Monday 03 May 2010 18:43:42 Ramin H wrote:
> Hi,
> I still don't know everything about C3T3 even though I have read the
> documentation. In a 3D triangulation, let's say the cell representing a
> facet does not belong to domain (subdomain=0). If we find the mirror cell
> of this facet, should it belong to the domain (subdomain > 0) ?
>
> To test this idea, I wrote the following code:
>
>   for(Facet_iterator facet_it = c3t3_.facets_begin() ;
>       facet_it != c3t3_.facets_end() ;
>       ++facet_it)
>   {
>     Facet facet = *facet_it;
>     const Facet f = c3t3_.triangulation().mirror_facet(facet);
>     if( (int)(facet.first->subdomain_index()) ==
> (int)(f.first->subdomain_index()) )
>     {
>       std::cerr << "Cell and it's mirror have equal subindex: " <<
> (int)(f.first->subdomain_index()) << std::endl;
>     }
>   }
>
> Here is some sample output:
> Cell and it's mirror have equal subindex: 1
> Cell and it's mirror have equal subindex: 1
> Cell and it's mirror have equal subindex: 0
> Cell and it's mirror have equal subindex: 1
> Cell and it's mirror have equal subindex: 1
> Cell and it's mirror have equal subindex: 1
> Cell and it's mirror have equal subindex: 0
> Cell and it's mirror have equal subindex: 1
>
> Is this correct behavior? If Facet_iterator is iterating over the facets on
> the surface, why a cell representing that facet and it's mirror both can
> have subdomain index equal to 1 or 0?

No it is not a correct behavior. There is an inconsistency between the answers
provided by the mesh domain oracle to the two following questions :
 - does a given segment/ray intersects the boundary of the domain,
 - is a given center of cell in the domain or not.

Does your domain class (CGAL::Polyhedral_mesh_domain_3 or something like that)
use a filtered (exact) kernel or an inexact one?

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss







-- 
Mariette Yvinec
Geometrica project team
INRIA  Sophia-Antipolis  





Archive powered by MHonArc 2.6.16.

Top of Page