[vtkusers] How to find if a point lies within a planewidget's plane?

Goodwin Lawlor goodwin.lawlor at ucd.ie
Mon May 19 10:11:50 EDT 2008


Hi Rashed,

The 3rd corner is the origin O... vtkPlaneWidget::GetOrigin()

Think of the plane being spanned by the two vectors OP1 and OP2. The 4th 
point is simply vector addition of O + OP1 + OP2

If you don't want to do it that way just use 
vtkPlaneWidget::GetPolyData() to access the 4 coords directly.

hth

Goodwin



rashed karim wrote:
> Hi Goodwin,
>
> Thanks for your reply. But, vtkPlaneWidget returns only the plane's 
> normal, center and two corner points (vtkPlaneWidget::GetPoint1( )  
> and vtkPlaneWidget::GetPoint2( ) ). How do I get the other two corner 
> points?
>
> To use PointInPolygon, you need to supply all four vertices of the 
> plane. But I only have two. How do I get the other two?
>
> Any ideas?
>
> Thanks
> Rashed
>
> On Mon, May 19, 2008 at 1:47 PM, Goodwin Lawlor <goodwin.lawlor at ucd.ie 
> <mailto:goodwin.lawlor at ucd.ie>> wrote:
>
>     Hi Rashed,
>
>     Have a look at:
>
>     vtkPolygon::PointInPolygon(
>      double  x[3],
>      int  numPts,
>      double *  pts,
>      double  bounds[6],
>      double  n[3]
>     )
>
>     hth
>
>     Goodwin
>
>
>     rashedk wrote:
>
>         Hi there,
>         I am stuck with a very trivial problem. How do I find out if a
>         point (a,b,c)
>         lies within a plane in 3D which is a constrained finite plane
>         and not an
>         infinite one. I have the coordinates of the two corners of the
>         plane as
>         returned by vktPlaneWidget's GetPoint1 and GetPoint2
>         functions. I also have
>         the plane's normal and center.
>         thanks in advance,
>         Rashed.
>
>
>




More information about the vtkusers mailing list