Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] [Polyhedron, Mesh ] Need a help to access vertex, halfedge, and faces after building polygons
Chronological Thread
- From: "Subramani Sellamani" <>
- To:
- Subject: Re: [cgal-discuss] [Polyhedron, Mesh ] Need a help to access vertex, halfedge, and faces after building polygons
- Date: Tue, 22 Apr 2008 12:04:00 -0400
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=SX7CKSrWjGaR8g0liwADslEg8ZO79wvaNNHMlW1y/ZH6ZtRIuFNx3Ij5q4QUcO4WAP08JSrSJbprLR/91x1i/k4MsJB5/8OrXzUayzW0XpS6KxQh/tPW8Z5Pw8zeXSOkm9lp2Rivo6ro4uofounWZj4kTm+dI2y2bLcgoVf1xDo=
Hello,
I am struggling in building 3D meshes from a set of points of 3D model (object file). I modified the example source code "Polyhedron_prog_incr_builder.cpp" as follows. After making all triangles from a set of points, I want to travel the meshes with the index and want to get vertex position. And I also need to find neighbor triangles sharing halfedges. How should I do this? I need your help. . I would really appreciate that you can send me a good example. Thank you in advance
Samuel
template <class HDS>
class Build_triangle : public CGAL::Modifier_base<HDS> {
public:
Build_triangle() {}
void operator()( HDS& hds) {
// Postcondition: `hds' is a valid polyhedral surface.
CGAL::Polyhedron_incremental_builder_3<HDS> B( hds, true);
int numofvertices = 1000; // Just define the number of surface points of 3D model
int numoffaces = 70;
B.begin_surface(numofvertex, numoffaces, 2* numofvertices);
typedef typename HDS::Vertex Vertex;
for(int i=0;i< numofvertices; i=+3 )
{
B.add_vertex( Points[i]));
B.add_vertex( Points[i+1]));
B.add_vertex( Points[i+2]));
B.begin_facet();
B.add_vertex_to_facet( i);
B.add_vertex_to_facet( i+1);
B.add_vertex_to_facet( i+2);
B.end_facet();
}
B.end_surface();
};
typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef Polyhedron::HalfedgeDS HalfedgeDS;
int main() {
Polyhedron P;
Build_triangle<HalfedgeDS> triangle;
P.delegate( triangle);
CGAL_assertion( P.is_triangle( P.halfedges_begin()));
/// I want to access vertex, half edges , and faces here ////
}
return 0;
--
Regards,
Mani
------------------------
- Re: [cgal-discuss] Linking Error, Mahmood Naderan, 04/22/2008
- [Polyhedron, Mesh ] Need a help to access vertex, halfedge, and faces after building polygons, samuel kim, 04/22/2008
- Re: [cgal-discuss] [Polyhedron, Mesh ] Need a help to access vertex, halfedge, and faces after building polygons, Subramani Sellamani, 04/22/2008
- [Polyhedron, Mesh ] Need a help to access vertex, halfedge, and faces after building polygons, samuel kim, 04/22/2008
Archive powered by MHonArc 2.6.16.