Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Re: CGAL 3d Mesh Triangulation. Facets with too many neighbors facets.

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Re: CGAL 3d Mesh Triangulation. Facets with too many neighbors facets.


Chronological Thread 
  • From: Michal Parusinski <>
  • To:
  • Subject: Re: [cgal-discuss] Re: CGAL 3d Mesh Triangulation. Facets with too many neighbors facets.
  • Date: Fri, 3 Sep 2010 13:23:43 +0100
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=tHxIPpf3r9esVlf0Sp9/BvYNhuvMA41RsU1PckKpZ/BYDJO1/VO7i1j4CZ7JKMr0zs UXayRVkrBhOY2L4PlHLKAhT/EjXAbULBl05pbYgpPQaltBg219wjK1bEhRAx3qSh7nxK wnu//v7yvAgK0mVm+njlRlMbdwfXc20fzpPGU=

Thanks, actually after some experimentation that's what I found.

On 3 September 2010 13:16, Ianic
<>
wrote:
>
> Cells are oriented positively, see
>
> http://www.cgal.org/Manual/3.7-beta1/doc_html/cgal_manual/Triangulation_3/Chapter_main.html#Section_37.1
>
> Facet is represented implicitly as a pair of 1) cell it belongs to and 2) an
> opposite vertex number. So you can look at a facet from two adjacent cells
> and therefore there is no orientation per se unless you enforce it somehow.
> The way I did it is this. First, I make sure that I look at a facet from
> within the domain of interest. Then I check the opposite vertex number i. If
> it is even (i = 0 or 2), then the positive facet (i.e. with vertices
> enumerated counterclockwise) will consist of cell vertices with numbers
>
> (i + 1) % 4, (i + 2) % 4, (i + 3) % 4.
>
> Otherwise it should be
>
> (i + 1) % 4, (i + 3) % 4, (i + 2) % 4.
>
> If you output facets this way, you will have a consistent surface
> orientation. Here is the portion of File_medit.h file that I edited to
> output it this way:
>
>  //-------------------------------------------------------
>  // Facets
>  //-------------------------------------------------------
>  int number_of_triangles = c3t3.number_of_facets();
>  if ( print_each_facet_twice )
>    number_of_triangles += number_of_triangles;
>
>  os << "Triangles" << std::endl
>     << number_of_triangles << std::endl;
>
>  for( Facet_iterator fit = c3t3.facets_begin();
>       fit != c3t3.facets_end();
>       ++fit)
>  {
>    const Facet f = ( c3t3.is_in_complex(fit->first) ) ? *fit :
> c3t3.triangulation().mirror_facet(*fit);
>    // facet vertices in CCW order
>    const Vertex_handle& vh1 = f.first->vertex( (f.second + 1)%4 );
>
>    const Vertex_handle& vh2 = (f.second % 2 != 1) ?
>                               f.first->vertex( (f.second + 2)%4 ) :
>                               f.first->vertex( (f.second + 3)%4 );
>
>    const Vertex_handle& vh3 = (f.second % 2 != 1) ?
>                               f.first->vertex( (f.second + 3)%4 ) :
>                               f.first->vertex( (f.second + 2)%4 );
>
>    os << V[vh1] << " " << V[vh2] << " " << V[vh3] << " ";
>    os << get(facet_pmap, f) << std::endl;
>
>    // Print triangle again if needed
>    if ( print_each_facet_twice )
>    {
>      os << V[vh1] << " " << V[vh2] << " " << V[vh3] << " ";
>      os << get(facet_twice_pmap, f) << std::endl;
>    }
>  }
>
> Hope this helps.
>
>
> mparusinski wrote:
>>
>> Actually how are the tetrahedra orientated and how are the facets
>> orientated in CGAL?
>>
>
> --
> View this message in context:
> http://cgal-discuss.949826.n4.nabble.com/CGAL-3d-Mesh-Triangulation-Facets-with-too-many-neighbors-facets-tp2332420p2525556.html
> Sent from the cgal-discuss mailing list archive at Nabble.com.
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
>
>



Archive powered by MHonArc 2.6.16.

Top of Page