Skip to Content.
Sympa Menu

cgal-discuss - RE: [cgal-discuss] Extended polyhedra & nef_polyhedra

Subject: CGAL users discussion list

List archive

RE: [cgal-discuss] Extended polyhedra & nef_polyhedra


Chronological Thread 
  • From: Chris Theis <>
  • To: "" <>
  • Subject: RE: [cgal-discuss] Extended polyhedra & nef_polyhedra
  • Date: Fri, 15 Feb 2013 16:13:36 +0000
  • Accept-language: en-GB, en-US

Hi Sebastien,

I don't want to waste your time with this. I saw in one of the demos that I
can handle the normals with the CGAL::compute_facet_normal() functions, which
should solve my problem.

For the Boolean ops I will check out your suggestion and I'll be happy to
provide feedback.

Cheers
Chris

-----Original Message-----
From:


[mailto:]
On Behalf Of Sebastien Loriot (GeometryFactory)
Sent: 15 February 2013 09:42
To:

Subject: Re: [cgal-discuss] Extended polyhedra & nef_polyhedra

I'm sorry but I can' compile a minimal example as I don't have all the
classes you use. It will same my time if you provide me a complete example
that does not compile.

Note that even if it were compiling, all the attributes of the
Polyhedron_3 won't be transfered to the Nef_polyhedron_3.

If you want to try the experimental boolean operations on Polyhedra, have a
look at the file CGAL/corefinement_operations.h

The class Polyhedron_corefinement is the one you should look at.
There is some documentation in doxygen style that should be sufficient to
start. If you try it, some feedback is welcome.

Sebastien.


On 02/15/2013 08:53 AM, Chris Theis wrote:
> Hello,
>
> My CItemsEx is the following code below. It's actually based on one of the
> provided examples. However, I found in one of the demos that there is a
> function to calculate normals for polyhedra. If there is no other way then
> I guess I can use this one and store all my other attributes in a wrapper
> class which will then contain the actual geometry solid as a member.
>
> //////////////////////////////////////////////////////////////////////
> ////////////////////////////
>
> struct CItemsEx : public CGAL::Polyhedron_items_3
>
> // A redefined items class for the Polyhedron_3 with a refined vertex
> class that contains a // member for the normal vector and a refined
> facet with a normal vector instead of the // plane equation (this is
> an alternative solution instead of using //
> Polyhedron_traits_with_normals_3).
> //////////////////////////////////////////////////////////////////////
> ////////////////////////////
> {
> // wrap vertex
> template<class Refs, class Traits>
> struct Vertex_wrapper
> {
> typedef typename Traits::Point_3 Point;
> typedef typename Traits::Vector_3 Normal;
> typedef CVertexEx<Refs,
> CGAL::Tag_true,
> Point,
> Normal> Vertex;
> };
>
> // wrap face
> template<class Refs, class Traits>
> struct Face_wrapper
> {
> typedef typename Traits::Point_3 Point;
> typedef typename Traits::Vector_3 Normal;
> typedef CFacetEx<Refs,
> CGAL::Tag_true,
> Point,
> Normal> Face;
> };
>
> // wrap halfedge
> template<class Refs, class Traits>
> struct Halfedge_wrapper
> {
> typedef typename Traits::Vector_3 Normal;
> typedef CHalfeEdgeEx<Refs,
> CGAL::Tag_true,
> CGAL::Tag_true,
> CGAL::Tag_true,
> Normal> Halfedge;
> };
> };
>
> Thanks a lot
> Chris
>
> ----------------------------------------------------------------------
> ------------------
> Chris Theis
> CERN/DGS-RP - European Organization for Nuclear Research
> 1211 Geneva 23, Switzerland
> Phone: +41 22 767 8069 Office: 892-2A-015
> e-mail:
>
> www: http://www.cern.ch/theis
> ----------------------------------------------------------------------
> -------------------
>
>
> -----Original Message-----
> From:
>
>
> [mailto:]
> On Behalf Of Sebastien Loriot
> (GeometryFactory)
> Sent: 15 February 2013 07:09
> To:
>
> Subject: Re: [cgal-discuss] Extended polyhedra& nef_polyhedra
>
> On 02/14/2013 05:14 PM, Chris Theis wrote:
>> Hi Sebastien,
>>
>> my problem actually starts when I do the following:
>>
>> CGAL::Polyhedron_3<Kernel,CItemsEx> TestPoly;
>> // CItemsEx is derived from Polyhedron_items_3 and extends vertices,
>> faces& halfedges
>> CGAL::Nef_polyhedron_3<Kernel> TestSolid( TestPoly );
>>
>> as long as I use
>>
>> CGAL::Polyhedron_3<Kernel, CGAL::Polyhedron_items_3> TestPoly;
>>
>> it's ok. I found that the constructor of nef-polyhedra accepts only
>> standard Polyhedron_3 objects without an extended items classifier. I
>> wanted to use the extended items in order to have a convenient way to
>> calculate and store normals for vertices, faces& halfedges as shown in
>> one of the examples.
>>
> Could I see what is CItemEx?
>
>> In principle I do not necessarily need nef-polyhedra if there is another
>> convenient way to do intersections, differences and unions of Polyhedron_3
>> objects. By definition all of my polyhedra should be closed. The only
>> other two requirements that I have is that I have to test if a point is
>> included in my polyhedron (and nef-polys provide a nice way to do this)
>> and an intersection query for rays.
>>
>> So if there is a different way to achieve this without using nef-polys
>> then I'll also be glad to give it a try.
>
> You can use the AABB_tree for those tasks.
> http://www.cgal.org/Manual/latest/doc_html/cgal_manual/AABB_tree/Chapt
> er_main.html
>
> Sebastien.
>
>>
>> I'm completely new to CGAL so I'm grateful for any information!
>>
>> Cheers
>> Chris
>>
>>
>> -----Original Message-----
>> From:
>>
>> [mailto:]
>> On Behalf Of Sebastien Loriot
>> (GeometryFactory)
>> Sent: 14 February 2013 17:01
>> To:
>>
>> Subject: Re: [cgal-discuss] Extended polyhedra& nef_polyhedra
>>
>> Do you have a minimal example showing the issue?
>>
>> Depending on what you need, you might be interested by the
>> corefinement plugin in the Polyhedron demo that performs boolean
>> operations on Polyhedra directly (select the two polyhedra in the A/B
>> column). The constraint is that the intersection polylines between
>> the polyhedra are closed (including the boundaries)
>>
>> Sebastien.
>>
>> On 02/14/2013 03:36 PM, Chris Theis wrote:
>>> Hello,
>>>
>>> I'm currently trying to implement a module which needs to perform
>>> boolean operations on polyhedra.
>>> In general I'm using a class which is derived from
>>> CGAL::Polyhedron_3 for managing my solids and for the boolean ops I
>>> would like to convert the polyhedra to nef_polyhedra and then back.
>>>
>>> If I do something like this:
>>>
>>> CSGPolyhedron<Kernel, CGAL::Polyhedron_items_3> TestPoly;
>>> CGAL::Nef_polyhedron_3<Kernel> TestSolid( TestPoly );
>>>
>>> then the compiler is happy. However, I have extended my polyhedron
>>> items so my actual conversion would look like:
>>>
>>> CSGPolyhedron<Kernel, CItemsEx> TestPoly;
>>> CGAL::Nef_polyhedron_3<Kernel> TestSolid( TestPoly );
>>>
>>> CItemsEx is derived from CGAL::Polyhedron_items_3 and handles the
>>> information for vertex& face normals. However, when I'm using my
>>> extended items then the compiler starts complaining:
>>>
>>> snc_structure.h(174): error C2903: 'Halffacet' : symbol is neither a
>>> class template nor a function template ....and many more error
>>> messages
>>>
>>> I could trace this problem back to the use of the extended items. In
>>> principle I would not need the extended functionality within the nef
>>> polyhedra. But I don't know how to do the conversion of my extended
>>> polyhedron to the nef_polyhedron. The available constructors do not
>>> seem to work.
>>>
>>> Is there any other way to do this? I'd greatly appreciate any hint
>>> in this direction because I would really like to keep my extended
>>> items for the polyhedra.
>>>
>>> Thanks a lot
>>> Chris
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://cgal-discuss.949826.n4.nabble.com/Extended-polyhedra-nef-poly
>>> h e dra-tp4656726.html Sent from the cgal-discuss mailing list
>>> archive at Nabble.com.
>>>
>>
>>
>> --
>> You are currently subscribed to cgal-discuss.
>> To unsubscribe or access the archives, go to
>> https://sympa.inria.fr/sympa/info/cgal-discuss
>>
>>
>>
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>
>
>


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





Archive powered by MHonArc 2.6.18.

Top of Page