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: Priyank Jain <>
  • To:
  • Subject: Re: [cgal-discuss] New to CGAL, problem with simple operations
  • Date: Thu, 1 Oct 2009 14:34:54 -0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=EwrpC+qYJF3gvi6uT061ZqReb86M3mV8JtuVdaghc7xVQnc8rRfP+oyAuqaYkyOUgj WIkccbVdGhTAKgApYwM/YsdW8DPHHeJw292Qrhhj5D1Qknavpng3nQ4n8sBalB8L+F7f 9y3/bak4CrYveYU6UZeYAWYixHZVeomhwAwU4=

Oh yea..my bad..i should really stop copy pasting code!

Here is my complete main():

int main()
{
    Point_3 p( 1.0, 0.0, 0.0);
    Point_3 q( 0.0, 1.0, 0.0);
    Point_3 r( 0.0, 0.0, 1.0);

    Polyhedron P;
    P.make_triangle(p,q,r);

    CGAL::set_ascii_mode( std::cout );
 std::cout << "H Edge info:" << std::endl;
for ( Halfedge_iterator hit = P.vertices_begin(); hit != P.vertices_end();
  ++hit) std::cout << hit->vertex()->point() << std::endl;

return 1;
}

I had one more question..more on a conceptual note.. What is the difference between a regular type and its handle variant, for e.g.: Vertex_handle vs Vertex ?

On Thu, Oct 1, 2009 at 12:46 PM, Laurent Rineau (GeometryFactory) <> wrote:
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/
--
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