Skip to Content.
Sympa Menu

cgal-discuss - Boolean operations using Nef Polyhedra

Subject: CGAL users discussion list

List archive

Boolean operations using Nef Polyhedra


Chronological Thread 
  • From: Bart Janssens <>
  • To:
  • Subject: Boolean operations using Nef Polyhedra
  • Date: Tue, 14 Aug 2007 23:39:25 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:to:subject:date:user-agent:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:sender; b=Axm6i+9BkI+DHPJEUjyG22U6fmm5vkM6P5kx1Nd0F+vlYhJVJzij2FChp7c367ENEKyqn/pIi6CB3nqg6OigfSkMKc4QZSKwXXFKhGrre/b8pdTZ0Lr6UtQ6qR25W88A7C8XUFx43+mX0/Y53VCZ/hFftqwy1iDIiyzv3VMtZ3A=

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.

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?
- Is there an example on how to iterate over the Nef_polyhedron_3
components
to directly convert them to another format? 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,

--
Bart Janssens



Archive powered by MHonArc 2.6.16.

Top of Page