Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] "Parts" of Polyhedron after a boolean operations.

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] "Parts" of Polyhedron after a boolean operations.


Chronological Thread 
  • From: Gilles Kneuss <>
  • To:
  • Subject: Re: [cgal-discuss] "Parts" of Polyhedron after a boolean operations.
  • Date: Wed, 2 Dec 2009 02:41:00 +0100
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=iLmbCHvb5Z/z1t+BMna0+SRrBbQ2SBIGjNiFtEkfQkZa79Zr9q1LeFk6bPB1JLnue4 vuQ2zLBq1Sp2PF2QLqplFZGhkxs+GBPDWVjRaBTcimpRQho8rJoHVsfkqgEm4ToPASHL /OHe+Qi01W34S4Ouk4sFkPokXPAPT8IHYWbJE=

Hi Pierre,

Thanks for quick reply !

Yes, I first transform my Polyhedrons into Nef Polyhedrons, I do the bool. op. and then I re-transform the result
into a PolyHedron.

Here is a sample of the code I use :
..

AC_Nef_Polyhedron* p1; // to say that will contain the knife !

AC_Nef_Polyhedron* p2; // that will contain the bread (salami works aswell)

AC_Nef_Polyhedron* p3=new AC_Nef_Polyhedron(this,NULL); // this will contain the result (a slice and the bread


 // this is specific to my app. (I get the bread and the knife from the view)


p1=dynamic_cast<AC_Nef_Polyhedron*>(contenu.at(1));

p2=dynamic_cast<AC_Nef_Polyhedron*>(contenu.at(3));


// I transform Poly into Nef..


Nef_polyhedron n1(*p1);

Nef_polyhedron n2(*p2);

// bool. op

n1 -= n2;



if(n1.is_simple()){

n1.convert_to_Polyhedron(*p3);

                    // this is specific to my app. (I erase all objet present in the view)

contenu.clear();

// I put the results (Bread+slice) into the view

contenu.append(p3);

p3->setInConstruction(false);

}
...

-> It works very well, but I would like to get the bread and the slice in two different PolyHedron..


Thanks in advance

Gilles


2009/12/2 Pierre Alliez <>
hi Gilles,

did you already apply the conversion from the nef polyhedron to the surface polyhedron?

then to do the split I would recommend using the incremental  builder in order to do the split into several polyhedra. let me know if you want some example code to use as starting point for this task.

Pierre Alliez
INRIA Sophia Antipolis - Mediterranee Project-team GEOMETRICA http://www-sop.inria.fr/members/Pierre.Alliez/
Tel: +33 4 92 38 76 77
Fax: +33 4 97 15 53 95



Gilles a écrit :

Hello all,

When I make a boolean op. on 3D Polyhedron and the result is completely parted
(for exemple, I cutted a cylinder into two distinct  parts),

 I would like to identify these two parts (to make two new Polyhedron
afterwards).



Anyone has an answer how can I proceed ?

Thanks for help.

 

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss





Archive powered by MHonArc 2.6.16.

Top of Page