Subject: CGAL users discussion list
List archive
- From: Peter Hachenberger <>
- To:
- Subject: Re: [cgal-discuss] Additional facets: why?
- Date: Mon, 04 Dec 2006 18:12:10 +0100
Hi
that's a rendering problem of geomview. The CGAL computations are
correct. Use the viewer of Nef_polyhedron_3. There will be no additional
facets in this viewer.
Peter
On Sun, 2006-11-26 at 19:55 +0100,
wrote:
> Hi,
>
> I have 2 additional facets with this very simple program:
>
> /*********************** CUT HERE *************************/
> #include "CGAL/basic.h" // Manuel page 7
> #include <CGAL/Gmpz.h>
> #include <CGAL/Exact_predicates_exact_constructions_kernel_with_sqrt.h>
> #include <CGAL/Polyhedron_3.h>
> #include <CGAL/Convex_hull_traits_3.h>
> #include <CGAL/convex_hull_3.h>
> #include <CGAL/Vector_3.h>
> #include <CGAL/IO/Geomview_stream.h>
> #include <CGAL/IO/Triangulation_geomview_ostream_3.h>
> #include <CGAL/IO/Polyhedron_geomview_ostream.h>
> #include <vector>
>
> #include <CGAL/Nef_polyhedron_3.h>
>
> typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt Kernel;
> typedef Kernel::RT RT;
>
> typedef CGAL::Nef_polyhedron_3<Kernel> Poly3D;
> typedef CGAL::Point_3<Kernel> Point3D;
>
> Poly3D MakeVol(Point3D a, Point3D b)
> {
> CGAL::Iso_cuboid_3<Kernel> cube(a,b);
> CGAL::Object ch_object;
> CGAL::Polyhedron_3<Kernel> p0;
> std::vector<Point3D> points;
>
> p0.clear();
> points.clear();
> for(int i=0;i<8;i++) points.push_back(cube.vertex(i));
>
> CGAL::convex_hull_3(points.begin(), points.end(), ch_object);
>
> if(CGAL::assign(p0, ch_object)!=true) {
> std::cout << "pn: convex hull error!" << std::endl;
> return(Poly3D());
> }
> return(Poly3D(p0));
> }
>
>
> int main(int argc, char argv[])
> {
> Poly3D b1=MakeVol(Point3D(1,1,1), Point3D(10,10,10));
> Poly3D b2=MakeVol(Point3D(1,1,9), Point3D(20,20,20));
>
> Poly3D b3=b1.join(b2);
>
> CGAL::Geomview_stream gv(CGAL::Bbox_3(-100, -100, -100, 600, 600, 600));
> gv.set_line_width(4);
> gv.set_bg_color(CGAL::Color(0, 200, 200));
> gv.clear();
>
> CGAL::Polyhedron_3<Kernel> p0;
> b3.convert_to_Polyhedron(p0);
> gv << p0;
>
> std::cout << "Enter a key to finish" << std::endl;
> char ch;
> std::cin >> ch;
>
> }
> /*********************** CUT HERE *************************/
> I use: gcc 4.1.2 (same problem with gcc 4.0.2)
> geomview-1.8.2-rc9
> gmp-4.2.1
> mpfr-2.2.0
> CGAL-3.2.1
>
> All of them home compilated.
>
> The 2 additional facets seems to be generated when the 2nd Nef_polyhedron_2
> is in the corner of the first.
>
> Does anyone has the same problem, or a solution?
>
> Thanks for help.
>
- Re: [cgal-discuss] Additional facets: why?, Peter Hachenberger, 12/04/2006
Archive powered by MHonArc 2.6.16.