Subject: CGAL users discussion list
List archive
- From: thierry Fernandez <>
- To:
- Subject: Re: [cgal-discuss] Nef polyhedron and nested shells
- Date: Fri, 12 Jun 2015 17:10:29 +0200
i think you have to use boolean operations like in this example:
Nef_polyhedron N1(Plane_3( 1, 0, 0,-1));
Nef_polyhedron N2(Plane_3(-1, 0, 0,-1));
Nef_polyhedron N3(Plane_3( 0, 1, 0,-1));
Nef_polyhedron N4(Plane_3( 0,-1, 0,-1));
Nef_polyhedron N5(Plane_3( 0, 0, 1,-1));
Nef_polyhedron N6(Plane_3( 0, 0,-1,-1));
Nef_polyhedron I1(!N1 + !N2); // open slice in yz-plane
Nef_polyhedron I2(N3 - !N4); // closed slice in xz-plane
Nef_polyhedron I3(N5 ^ N6); // open slice in yz-plane
Nef_polyhedron Cube1(I2 * !I1);
Cube1 *= !I3;
Nef_polyhedron Cube2 = N1 * N2 * N3 * N4 * N5 * N6;
CGAL_assertion(Cube1 == Cube2); // both are closed cube
CGAL_assertion(Cube1 == Cube1.closure());
CGAL_assertion(Cube1 == Cube1.regularization());
CGAL_assertion((N1 - N1.boundary()) == N1.interior());
CGAL_assertion(I1.closure() == I1.complement().interior().complement());
CGAL_assertion(I1.regularization() == I1.interior().closure());
return 0
2015-06-12 16:23 GMT+02:00 Qingnan Zhou <>:
I have created a minimal example to illustrate this problem. The code is really short and can be downloaded fromPlease let me know if you are not able to reproduce my result. Any help would be appreciated.best,JamesOn Sat, Jun 6, 2015 at 11:50 AM, Qingnan Zhou <> wrote:Dear all,I noticed that CGAL's Nef Polyhedron gave incorrect result when the input contains multiple nested shells such as the nested_ball.off, which consists of 4 concentric spheres with normals pointing outward and inward in an alternating fashion. When intersecting it with rectangular block, box.off, it produces the following output: out.off:Where the correct output should be the following:Is there anything special I need to do when using CGAL's Nef polyhedron class? Thanks in advance!best,James
- [cgal-discuss] Nef polyhedron and nested shells, Qingnan Zhou, 06/06/2015
- Re: [cgal-discuss] Nef polyhedron and nested shells, Qingnan Zhou, 06/12/2015
- Re: [cgal-discuss] Nef polyhedron and nested shells, thierry Fernandez, 06/12/2015
- Re: [cgal-discuss] Nef polyhedron and nested shells, Qingnan Zhou, 06/12/2015
Archive powered by MHonArc 2.6.18.