Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Boolean operations using Nef Polyhedra

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Boolean operations using Nef Polyhedra


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] Boolean operations using Nef Polyhedra
  • Date: Wed, 15 Aug 2007 02:43:03 -0700

Hi Bart,

Bart Janssens wrote:
Hello all,

I am currently trying to implement boolean operations in the K-3D 3D modeler (http://www.k-3d.org) by making use of the CGAL library.

Note that there may be license problems as you cannot combine GPLed
and QPLed software. If you are the author of GPLEd code you can add
an exception, but as you use other third party libs, the problem remains.

The method I initially intended to use was to convert from K-3D to CGAL Polyhedra, then convert to Nef Polyhedra, apply the boolean operation, convert back to CGAL Polyhedra using convert_to_Polyhedron and then finally convert back to the K-3D format.

Unfortunately, the convert_to_Polyhedron method only converts the N2-N1 test case as seen on http://www.k-3d.org/wiki/CGAL_Boolean_Operations

This leaves me with the following questions:
- Is there an easy way to eliminate the hole seen in the N1-N2 test-case that I have missed in the documentation?

It is not really a hole you see, but an open face. It's just like in math
when you speak about intervals that are open or closed. For me a hole is
something
that hs some depth, but that's not the case here. The closure operation
should close this, but it wouldn't do selectively, but apply it to the
entire polyhedron.

- Is there an example on how to iterate over the Nef_polyhedron_3 components to directly convert them to another format?

What do you mean with components? Connected 3D space ?

andreas

The K-3D format supports holes, so it might be possible to convert without eliminating the holes. The iteration I use to convert from Polyhedron_3 to K-3D looks like this:

------------------------------------------------------------------------------------------------------------------
for (Polyhedron::Facet_const_iterator f = Polyhedron.facets_begin(); f != Polyhedron.facets_end(); ++f)
{
Polyhedron::Facet::Halfedge_around_facet_const_circulator facet_start = f->facet_begin();
Polyhedron::Facet::Halfedge_around_facet_const_circulator
edge_circulator =
facet_start;
do
{
const Polyhedron::Halfedge& halfedge = *edge_circulator;
// K-3D stuff
++edge_circulator;
} while (facet_start != edge_circulator); }
------------------------------------------------------------------------------------------------------------------

I was wondering if it is possible to do something similar (though more complicated, probably :) using a Nef Polyhedron.

Kind regards,




Archive powered by MHonArc 2.6.16.

Top of Page