Skip to Content.
Sympa Menu

cgal-discuss - CGAL (need suggestion for surface mesh refinement)

Subject: CGAL users discussion list

List archive

CGAL (need suggestion for surface mesh refinement)


Chronological Thread 
  • From: "Santosh Tiwari" <>
  • To: <>
  • Subject: CGAL (need suggestion for surface mesh refinement)
  • Date: Wed, 12 Mar 2008 22:11:10 -0400
  • Organization: Clemson University

I am learning to use CGAL.

Is it possible to use CGAL to refine a surface mesh (input is a STL file - a
triangle soup)? The STL represents a 3D object, but it may not be a manifold
and some of the triangles might be intersecting with each other. Does CGAL
provide any functionality to refine a surface mesh?

Thanks,
__
Santosh Tiwari
EIB-326 Clemson University
http://www.clemson.edu/~stiwari/




-----Original Message-----
From: Andreas Fabri
[mailto:]

Sent: Monday, March 10, 2008 3:54 AM
To:

Subject: Re: [cgal-discuss] CGAL (need help writing the facets to a file)

Hi Santosh,

You might have a look at this helper class, which is the base class of the
3D triangulation classes,
http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/TriangulationDS_3_ref/Cl
ass_Triangulation_utils_3.html#Cross_link_anchor_994

andreas


Santosh Tiwari wrote:
> I had to modify the code as suggested in the previous mail to get the
> correct list of vertices.
>
> x1 = (*(iter->first->vertex((iter->second+1)%4))).point().x();
> y1 = (*(iter->first->vertex((iter->second+1)%4))).point().y();
> z1 = (*(iter->first->vertex((iter->second+1)%4))).point().z();
>
> x2 = (*(iter->first->vertex((iter->second+2)%4))).point().x();
> y2 = (*(iter->first->vertex((iter->second+2)%4))).point().y();
> z2 = (*(iter->first->vertex((iter->second+2)%4))).point().z();
>
> x3 = (*(iter->first->vertex((iter->second+3)%4))).point().x();
> y3 = (*(iter->first->vertex((iter->second+3)%4))).point().y();
> z3 = (*(iter->first->vertex((iter->second+3)%4))).point().z();
>
> I have a few questions.
>
> How do I know what is the correct CCW direction for the nodes, such that
the
> facet normal points outside?
>
> Some of the triangles seem wrong (I can post the snapshot of the original
> object and the obtained object if desired).
>
> Thanks again.
> __
> Santosh Tiwari
> EIB-326 Clemson University
> http://www.clemson.edu/~stiwari/
>
>
>
>
> -----Original Message-----
> From: Santosh Tiwari
> [mailto:]
>
> Sent: Sunday, March 09, 2008 3:43 PM
> To:
>
> Subject: RE: [cgal-discuss] CGAL (need help writing the facets to a file)
>
> Thanks a lot.
>
> I am able to write the facets now. I am using the following code snippet.
>
> //write the facets;
> list<Facet> facets;
> as.get_alpha_shape_facets(back_inserter(facets),
> Alpha_shape_3::REGULAR);
> cout<<facets.size()<<" boundary facets \n";
> int numFacets = 0;
> for(list<Facet>::const_iterator iter = facets.begin();
> iter!=facets.end(); ++iter) {
> cout<<"Facet "<<++numFacets<<endl;
> cout<<(*(iter->first->vertex(1))).point()<<", ";
> cout<<(*(iter->first->vertex(2))).point()<<", ";
> cout<<(*(iter->first->vertex(3))).point()<<endl;
> }
>
> Thanks again. :)
>
> __
> Santosh Tiwari
>
>
>
>
> -----Original Message-----
> From: Manuel Caroli
> [mailto:]
>
> Sent: Sunday, March 09, 2008 6:44 AM
> To:
>
> Subject: Re: [cgal-discuss] CGAL (need help writing the facets to a file)
>
> Hi Santosh,
>
> Santosh Tiwari wrote:
>> Hello,
>>
>> I am learning to use CGAL.
>>
>> I want to output the vertices of a list of Facets on the screen. How do I
> do
>> it?
>>
>> Any help or references would be appreciated. Following is the code
> snippet,
>> I am using.
> The triangulation data structure stores facets only implicitly:
>
http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/TriangulationDS_3/Chapte
> r_main.html
>
http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/TriangulationDS_3_ref/Co
> ncept_TriangulationDataStructure_3.html
>
> Short explanation:
> A facet is represented as a pair of a Cell_handle ch of a cell to which
> the facet is incident and an int i such that ch->vertex(i) gives you the
> only vertex that is not incident to the facet (the opposite vertex).
> To output the all vertices of the facet f you could do something like
> std::cout<<f.first->vertex((f.second+1)%4)<<", "
> <<f.first->vertex((f.second+2)%4)<<", "
> <<f.first->vertex((f.second+3)%4)<<std::endl;
>
> Best
>
> Manuel

--
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