Nef Polyhedron with color faces

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Nef Polyhedron with color faces

Ravi Kumaran
Hello,

From the example provided in CGAL package I understood how to extend CGAL::Polyhedron_items_3 so as to define polyhedra with colored faces. 
http://www.cgal.org/Manual/latest/examples/Polyhedron/polyhedron_prog_color.cpp

In a project I am working on, I am trying to apply boolean operations on polyhedron by converting them to Nef_polyhedron_3. I could not however figure out how can one preserve the color information of underlying polyhedra faces during this process.

I tried a naive implementation by defining extension of Polyhedron_items_3 and passing it to the Nef_polyhedron_3 template. However that doesn't seem to be right, because the template parameter  CGAL::Polyhedron_items_3 seems incompatible with CGAL::Default_items<Nef_polyhedronTraits_3>

Is there any way I can use CGAL templates to extend Nef_polyhedron to handle colored faces?

Thanks in advance.
--
Ravi

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

Reply | Threaded
Open this post in threaded view
|

Re: Nef Polyhedron with color faces

Sebastien Loriot (GeometryFactory)
Ravi Kumaran wrote:

> Hello,
>
> From the example provided in CGAL package I understood how to extend CGAL::Polyhedron_items_3 so as to define polyhedra with colored faces.
> http://www.cgal.org/Manual/latest/examples/Polyhedron/polyhedron_prog_color.cpp
>
> In a project I am working on, I am trying to apply boolean operations on polyhedron by converting them to Nef_polyhedron_3. I could not however figure out how can one preserve the color information of underlying polyhedra faces during this process.
>
> I tried a naive implementation by defining extension of Polyhedron_items_3 and passing it to the Nef_polyhedron_3 template. However that doesn't seem to be right, because the template parameter  CGAL::Polyhedron_items_3 seems incompatible with CGAL::Default_items<Nef_polyhedronTraits_3>
>
> Is there any way I can use CGAL templates to extend Nef_polyhedron to handle colored faces?
>
> Thanks in advance.
> --
> Ravi
>
This is not easily doable
(this imply hacks on non-documented stuff, and I am not even sure it
will work as expected).

If you describe why you need "color" in faces (and what expect in the
output), we may provide an alternative solution.

S.


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

Reply | Threaded
Open this post in threaded view
|

Re: Nef Polyhedron with color faces

Ravi Kumaran
 
>This is not easily doable
>(this imply hacks on non-documented stuff, and I am not even sure it will work as expected).

>If you describe why you need "color" in faces (and what expect in the
>output), we may provide an alternative solution
.
Thanks for the response. I've a small CAD program that shows different solid shapes which have different user selected colors. User can fuse more than one such solids with each other, I try to accomplish that by converting the solid polyhedra to Nef polyhedra and then performing union operation. Since there is no way to maintain the color information of faces as they pass through Nef polyhedra operations, the final solid will have to be shown in a single arbitrary color. This is not a big problem if the user's ultimate goal is mainly solid modelling or 3D printing. But the colors are important if the goal is 3D scene design/ visual effects etc.

Could you point me in any particular direction, regarding the possible hack you mentioned?

Thanks.
--
Ravi

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

Reply | Threaded
Open this post in threaded view
|

Re: Nef Polyhedron with color faces

Sebastien Loriot (GeometryFactory)
Ravi Kumaran wrote:
>  
>> This is not easily doable
>> (this imply hacks on non-documented stuff, and I am not even sure it will work as expected).
>
>> If you describe why you need "color" in faces (and what expect in the
>> output), we may provide an alternative solution
> .
> Thanks for the response. I've a small CAD program that shows different solid shapes which have different user selected colors. User can fuse more than one such solids with each other, I try to accomplish that by converting the solid polyhedra to Nef polyhedra and then performing union operation. Since there is no way to maintain the color information of faces as they pass through Nef polyhedra operations, the final solid will have to be shown in a single arbitrary color. This is not a big problem if the user's ultimate goal is mainly solid modelling or 3D printing. But the colors are important if the goal is 3D scene design/ visual effects etc.
>
To me it is not clean if you need a color information per face or per
solid?

> Could you point me in any particular direction, regarding the possible hack you mentioned?
Hard to say. Don't even know if this is doable.
Consider the case of two cubes sharing a 2D-face, if you do a union
operation the result will contains only 6 facets (the nef polyhedron
have remove a superfluous edge).


>
> Thanks.
> --
> Ravi
>


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

Reply | Threaded
Open this post in threaded view
|

Re: Nef Polyhedron with color faces

Pranav
Hi Sebastien,

Sebastien Loriot (GeometryFactory) wrote
To me it is not clean if you need a color information per face or per
solid?
My problem requires preserving color information per solid. Do we have any solution for the same?

With regards,
Pranav