Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] New to CGAL, problem with simple operations

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] New to CGAL, problem with simple operations


Chronological Thread 
  • From: "Laurent Rineau (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] New to CGAL, problem with simple operations
  • Date: Thu, 1 Oct 2009 18:46:23 +0200
  • Organization: GeometryFactory

On Thursday 01 October 2009 18:30:20

wrote:
> Hi,
>
> I'm very new to CGAL and have been trying to get it to work for quite some
> time now. I am trying to implement the Marching Triangle Algorithm and
> using CGAL for that.
>
> The first requirement there is that I need to iterate through all the edges
> that lie on the boundary of a model. I can't get it to work properly..
>
> This is what I am using:
> typedef CGAL::Simple_cartesian<double> Kernel;
>
> typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
>
> typedef Polyhedron::Halfedge_handle Halfedge_handle;
> typedef Polyhedron::Vertex_iterator Vertex_iterator;
> typedef Polyhedron::Halfedge_iterator Halfedge_iterator;
> typedef Polyhedron::Edge_iterator Edge_iterator;
>
> // main() and making a simple polyhedron out of a triangle.
> P.make_triangle(p,q,r);
> std::cout << "H Edge info:" << std::endl;
> for ( Halfedge_iterator hit = P.vertices_begin(); hit != P.vertices_end();
> ++v) std::cout << hit->vertex()->point() << std::endl;

Here you increase 'v' in the third part of the 'for'. It should be '++hit'.

Anyway, maybe your error is somewhere else. I have not looked in details at
your message.

--
Laurent Rineau, PhD
Release Manager of the CGAL Project
http://www.cgal.org/
R&D Engineer at GeometryFactory
http://www.geometryfactory.com/



Archive powered by MHonArc 2.6.16.

Top of Page