Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Bug in Nef_polyhedron_3 (II v_first, II v_last) ?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Bug in Nef_polyhedron_3 (II v_first, II v_last) ?


Chronological Thread 
  • From: Peter Hachenberger <>
  • To:
  • Subject: Re: [cgal-discuss] Bug in Nef_polyhedron_3 (II v_first, II v_last) ?
  • Date: Wed, 29 Aug 2007 13:47:27 +0200

I guess the constructor Nef_polyhedron_3 (II v_first, II v_last)
does something totally different than you expect. This constructor
creates a Nef_polyhedron_3 that is a polygon. If you want to create a
Nef_polyhedron_3 from a point cloud, you can construct a convex
Polyhedron_3 via convex_hull_3 and convert it to a Nef_polyhedron_3.

Peter

On Wed, 2007-08-29 at 08:12 +0200, Zorglub78 wrote:
> Hi all,
>
> When I try to use this very trivial code:
>
> #include <CGAL/basic.h>
> #include <CGAL/Gmpq.h>
> #include <CGAL/Homogeneous.h>
> #include <CGAL/Nef_polyhedron_3.h>
>
> typedef CGAL::Gmpz NT;
> typedef CGAL::Homogeneous<NT> Kernel3D;
> typedef Kernel3D::Point_3 Point3D;
> typedef CGAL::Iso_cuboid_3<Kernel3D> Cuboid3D;
> typedef CGAL::Nef_polyhedron_3<Kernel3D> Polyhedron3D;
>
> using std::vector;
>
> int main(int argc, char** argv)
> {
>
> Cuboid3D c1(Point3D(0,0,0), Point3D(3,3,3));
> vector<Point3D> vp;
> for(u_int i=0; i<8; ++i)
> vp.push_back(c1[i]);
>
> Polyhedron3D p(vp.begin(), vp.end(), true);
> }
>
> Execution fails with the following error:
> "Conversion from vertex cycle to Nef_polyhedron_3 was not successful.
> Error history: Direction of projection is 'z'. -> Different vertices are
> projected to same location! Now, direction of projection is 'x'. ->
> Different vertices are projected to same location! Now, direction of
> projection is 'y'. -> Different vertices are projected to same location!
> Finally, empty Nef_polyhedron_3 was constructed."
>
> Am I doing wrong something, or is there a bug in Nef_polyhedron_3 (II
> v_first, II v_last) ?
>
> Thanks for responses.
>
>



Archive powered by MHonArc 2.6.16.

Top of Page