Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Custom Vertex type in Polyhedron_3

Subject: CGAL users discussion list

List archive

[cgal-discuss] Custom Vertex type in Polyhedron_3


Chronological Thread 
  • From: Matthias Teich <>
  • To:
  • Subject: [cgal-discuss] Custom Vertex type in Polyhedron_3
  • Date: Wed, 13 May 2009 14:04:55 +0200

Hi again!

I need your help once again :(
I am trying to store normals in the vertices of a polyhedron_3, so I have written the following Items class:


#include <CGAL/Polyhedron_3.h>
#include <CGAL/HalfedgeDS_vertex_base.h>
#include <CGAL/HalfedgeDS_halfedge_base.h>
#include <CGAL/HalfedgeDS_face_base.h>

struct MyPolyhedronItems{
template < class Refs, class Traits>
struct Vertex_wrapper{
typedef typename Traits::Vector_3 Normal;
typedef typename Traits::Point_3 Point;
typedef CGAL::HalfedgeDS_vertex_base< Refs, CGAL::Tag_true, Point> Vertex;
};
template < class Refs, class Traits>
struct Halfedge_wrapper {
typedef CGAL::HalfedgeDS_halfedge_base< Refs> Halfedge;
};
template < class Refs, class Traits>
struct Face_wrapper {
typedef typename Traits::Plane_3 Plane;
typedef CGAL::HalfedgeDS_face_base< Refs, CGAL::Tag_true, Plane> Face;
};
};


My Polyhedron is defined as
typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Polyhedron_3<Kernel, MyPolyhedronItems> Polyhedron;

Everything seems to be fine, but I cant access the normals.

This is how I tried:
Vertex_iterator cv_it = polyhedron.vertices_begin();
Vector_3 n = cv_it->Normal;

Can anyone please tell me how to access them? It cannot be too hard I guess, but I dont get it.

Best regards,
Matthias



Archive powered by MHonArc 2.6.16.

Top of Page