[vtkusers] Best fitting plane....
Goodwin Lawlor
goodwin.lawlor at ucd.ie
Thu Mar 25 07:28:40 EST 2004
Hi,
You can use...
void vtkOBBTree::ComputeOBB (
vtkPoints *pts,
float corner[3],
float max[3],
float mid[3],
float min[3],
float size[3]
)
...to do what Malcolm suggests below. max[3] and mid[3] are in plane,
and min[3] is the plane normal. You can use the mean of the points to be
the plane origin.
Hth,
Goodwin
From: "Malcolm Drummond" <malcolm at geovision.co.za>
To: "vtkusers" <vtkusers at vtk.org>
Subject: Re: [vtkusers] Best fitting plane....
Date: Thu, 25 Mar 2004 12:09:18 +0200
Organization: GeoVision cc
Hi Andres
Leo van Ruijven posted a response to a similar question some time back
describing an eigenvector method.
For every x,y,z calculate products xx,xy,xz,yy,yz,zz. Put sums of
products in 3*3 matrix (ie. sxx,sxy,sxz;sxy,syy,syz;sxz,syz,szz) which
now represents an ellipsoid bounding your point-set. Use vtkMath to
calculate the eigenvectors and eigenvalues. The two largest values are
in the plane, the smallest is normal to the plane.
Let me know if you have any problems, I used this method recently and
could dig up some demo code if you need it.
HTH
Malcolm
----- Original Message -----
From: "Andres Barrera" <andresba at hotmail.com>
To: <vtkusers at vtk.org>
Sent: Wednesday, March 24, 2004 7:06 PM
Subject: [vtkusers] Best fitting plane....
> Dear list,
>
> On Fri, 22 Mar 2002 16:39:55 +0100, Anner Adrian wrote:
>
> >>Hello,
> >>
> >>is in vtk a function to find the best fit for a plane with n-points?
> >>I have n-points and now I want place a vtkPlaneSource so that the
> >>distance from the plane to the points is minimal.
>
> I need to solve a similar problem now, but I could find any answer to
> that in the User's List archives.
>
> Is there any defined way of calculating the best fitting plane through
> a series of points in vtk?
>
> Thank you in advance
>
> Andres
>
> _________________________________________________________________
> Get reliable access on MSN 9 Dial-up. 3 months for the price of 1!
> (Limited-time offer)
>
http://join.msn.com/?page=dept/dialup&pgmarket=en-us&ST=1/go/onm00200361
ave/
direct/01/
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list