Subject: CGAL users discussion list
List archive
- From: "Junqiao\(John\) Zhao" <>
- To: <>
- Subject: RE: [cgal-discuss] Re: orient triangles
- Date: Thu, 8 Nov 2012 10:56:06 +0100
Hi Guillaume,
Thanks for the reply!
Translating along the normal may be dangerous. I would try to project one of
the triangles to the 2 times bigger AABB box. And then shoot a perpendicular
ray from the center of that projected triangle (if existed) towards the
interior of that box. Then, I would count the intersections between the ray
and the polyhedron and find the closest one to the start point. Finally
comparing the normal of that intersection point with the direction of the
ray. If the closest intersection is on a vertex, then select another
triangle.
Regards, John
-----Original Message-----
From:
[mailto:]
On Behalf Of Guillaume Damiand
Sent: Wednesday, November 07, 2012 8:37 AM
To:
Subject: Re: [cgal-discuss] Re: orient triangles
Le 06/11/2012 18:18, johnzjq a écrit :
> Is there any simpler solution to it, without knowing the global knowledge
> about the polyhedron?
Orientation is a global property.
Indeed, you can build two objects having exactly a same local
configuration but with two opposite orientations.
To orient correctly a polyhedron, you can take a face with a given
orientation, compute its normal, take a point in the face, translate it
along the normal, and test if this point is inside or outside to the
polyhedron (counting the number of intersections of a half-line starting
from the point and the polyhedron).
Depending on which orientation you want, you conclude if the initial
orientation is correct or wrong; then you propagate the correct
orientation to all the faces of the polyhedron.
Guillaume
>
>
>
> --
> View this message in context:
http://cgal-discuss.949826.n4.nabble.com/orient-triangles-tp952874p4656161.h
tml
> Sent from the cgal-discuss mailing list archive at Nabble.com.
>
--
===================================================================
Guillaume DAMIAND
CNRS - LIRIS UMR 5205
Université Claude Bernard
Bâtiment Nautibus (710)
43 Boulevard du 11 Novembre 1918
69622 Villeurbanne Cedex (France)
-------------------------------------------------------------------
Tél: +33 (0)4.72.43.26.62 Fax: +33 (0)4.72.43.15.36
Mail:
Web: http://liris.cnrs.fr/guillaume.damiand/
===================================================================
- [cgal-discuss] Re: orient triangles, johnzjq, 11/06/2012
- Re: [cgal-discuss] Re: orient triangles, Guillaume Damiand, 11/07/2012
- Re: [cgal-discuss] Re: orient triangles, Sebastien Loriot (GeometryFactory), 11/08/2012
- RE: [cgal-discuss] Re: orient triangles, Junqiao(John) Zhao, 11/08/2012
- <Possible follow-up(s)>
- [cgal-discuss] Re: orient triangles, johnzjq, 11/06/2012
- Re: [cgal-discuss] Re: orient triangles, Guillaume Damiand, 11/07/2012
Archive powered by MHonArc 2.6.18.