Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] 3D-Point inside a 3D Polyhedron facet query

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] 3D-Point inside a 3D Polyhedron facet query


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] 3D-Point inside a 3D Polyhedron facet query
  • Date: Thu, 06 Jan 2011 17:37:50 +0100

Arun Ramasamy wrote:
HI,
I've to determine if a given 3D point is inside a 3D facet of a polyhedron. The facet is guaranteed to be a convex polygon and point is guaranteed to be in the same plane as the facet. Currently I'm planning to either
1. rotate everything to the X-Y plane and do a 2D evaluation using sign of angles and such or
2. Remove the least varying component from the facet and point coordinates (say Z) and do a 2D evaluation.

Is there any better way to do this, where I don't have to reduce this to a 2D operation. Is that query supported in CGAL ?

Please let me know if anything is not clear.
thanks arun


You can use function coplanar_orientation with consecutive segments of
the facet:

http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Kernel_23_ref/Function_coplanar_orientation.html#Index_anchor_428

Note that the point has to be in the plane (not almost in the plane).
If your point is not exactly in the plane, using a projection along x,y
or z axis should be a better solution (check the normal vector of the
plane to choose which one).

FYI, in the next release, they will probably be something called
Projection_traits that allows to use to 2D algorithms on 3D points
by considering them as 2D points projected onto a plane (xy, yx or
zx). With this traits used together with Polygon_2::bounded_side
(http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Polygon_ref/Class_Polygon_2.html)
you could also have the answer.

S.



Archive powered by MHonArc 2.6.16.

Top of Page