Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Obtaining coordinates from vertex_handle in CGAL::Polyhedron_3<CGAL::Exact_predicates_exact_constructions_kernel>

Subject: CGAL users discussion list

List archive

[cgal-discuss] Obtaining coordinates from vertex_handle in CGAL::Polyhedron_3<CGAL::Exact_predicates_exact_constructions_kernel>


Chronological Thread 
  • From: Matthias Teich <>
  • To:
  • Subject: [cgal-discuss] Obtaining coordinates from vertex_handle in CGAL::Polyhedron_3<CGAL::Exact_predicates_exact_constructions_kernel>
  • Date: Wed, 20 May 2009 11:57:27 +0200

Hello again!

I am trying to obtain the x,y,z coordinates of a vertex in a CGAL::Polyhedron_3<CGAL::Exact_predicates_exact_constructions_kernel>.

Therefor I do something like the following:

#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>

typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef Polyhedron::Vertex_iterator Vertex_iterator;
typedef Kernel::Point_3 Point_3;

void test()
{
Polyhedron p;
for ( Vertex_iterator v = p.vertices_begin(); v != p.vertices_end(); ++v)
{
Point_3 point = v->point();
double d0 = point.x();
}
}


The VS compiler says
"error C2440: 'initializing' : cannot convert from 'CGAL::Lazy_exact_nt<ET_>' to 'double'
with
[
ET_=CGAL::Gmpq
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called"

In the original code p is converted from a typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron.

I guess it is a problem with the kernels, but I have no clue how to solve it.
The simple cartesian kernel does not seem to work with nef_polyhedra and with the Exact_predicates_exact_constructions_kernel I can't access the coordinates of the vertices.

Best Regards,
Matthias



Archive powered by MHonArc 2.6.16.

Top of Page