Reverse the orientation of a single face?

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

Reverse the orientation of a single face?

kevin.kai.xu
Dear all,

Is there any way to reverse the orientation of a single face (given by a halfedge handle) in a polygonal mesh?

Now I know how to reverse the orientaions of all faces. This can be achieved by calling:
void Polyhedron_3<..>.inside_out ()  ------ reverses facet orientations

How do I deal with a single face?
--
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: Reverse the orientation of a single face?

andreas.fabri
[hidden email] wrote:
> Dear all,
>
> Is there any way to reverse the orientation of a single face (given by a halfedge handle) in a polygonal mesh?
>
> Now I know how to reverse the orientaions of all faces. This can be achieved by calling:
> void Polyhedron_3<..>.inside_out ()  ------ reverses facet orientations
>
> How do I deal with a single face?

Hi Kevin,

What would be the meaning of this?  Faces must be oriented in a consistent
way, that is two faces sharing an edge, must be  hooked up with two
opposite halfedges. So the orientation of one face implies the orientation
of the neighbor faces, and changing the orientation of one face, does
not really make sense.

What you can do is have an adapter layer, add a boolean flag to your Face type,
and write an iterator adaptor that when you call operator++ for a halfedge
circulator internally calls operator--

andreas
--
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: Reverse the orientation of a single face?

kevin.kai.xu
Hi Andreas,

Thanks for your reply.

> What would be the meaning of this?  Faces must be oriented in a consistent
> way, that is two faces sharing an edge, must be  hooked up with two
> opposite halfedges. So the orientation of one face implies the orientation
> of the neighbor faces, and changing the orientation of one face, does
> not really make sense.

The truth is I'm loading a mesh file in which there are indeed some
faces with inconsistent orientation with its neighbors. So, is there
any way to detect this inconsistency during loading the mesh?

> What you can do is have an adapter layer, add a boolean flag to your Face
> type,
> and write an iterator adaptor that when you call operator++ for a halfedge
> circulator internally calls operator--

This is a good idea! But is there a method to make the orientations of
all faces consistent anyway?

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