Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Triangulation_3 problem
- Date: Fri, 10 Feb 2012 12:00:56 +0100
Do you know how to display a set of edges in OpenGL?
If no you should ask your favorite internet search engine for a solution
(there are a lot of tutorials about that)
To extract points from edges in CGAL, you can do something like that:
for( typename Triangulation_3<GT, TDS>::Finite_edges_iterator
eit = T.finite_edges_begin(); eit != T.finite_edges_end(); ++eit)
{
GT::Point_3 pt1=eit->first->vertex(eit->second)->point();
GT::Point_3 pt2=eit->first->vertex(eit->third)->point();
}
See here for the definition of edges and Facets in 3D triangulations.
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/TriangulationDS_3_ref/Concept_TriangulationDataStructure_3.html#Cross_link_anchor_1368
//this is the part you need to look at
typedef Triple<Cell_handle, int, int>
Edge; (c,i,j) is the edge of cell c whose vertices indices are i and j. (See Section 39.1.)
typedef std::pair<Cell_handle, int>
Facet; (c,i) is the facet of c opposite to the vertex of index i. (See Section 39.1.)
//
Sebastien.
On 02/10/2012 11:50 AM, mysmax wrote:
Hello check this snippet
// Finite edges indices.
for( typename Triangulation_3<GT, TDS>::Finite_edges_iterator
eit = T.finite_edges_begin(); eit != T.finite_edges_end(); ++eit) {
gv<< 2
<< V[(*eit).first->vertex((*eit).second)]
<< V[(*eit).first->vertex((*eit).third)]
<< "\n"; // without color.
//<< 4<< drand48()<< drand48()<< drand48()<< 1.0; // random
color.
}
how to render this output in opengl?.
Advance thanks
mysmax
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Triangulation-3-problem-tp4375897p4375897.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Triangulation_3 problem, mysmax, 02/10/2012
- Re: [cgal-discuss] Triangulation_3 problem, Sebastien Loriot (GeometryFactory), 02/10/2012
- Re: [cgal-discuss] Triangulation_3 problem, Philipp Moeller, 02/10/2012
- [cgal-discuss] Re: Triangulation_3 problem, mysmax, 02/10/2012
Archive powered by MHonArc 2.6.16.