[vtk-developers] BestFitPlane function for vtkPlane

Karthik Krishnan karthik.krishnan at kitware.com
Wed Nov 4 11:28:43 EST 2009


On Wed, Nov 4, 2009 at 10:33 AM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:

> On Wed, Nov 4, 2009 at 8:28 AM, Karthik Krishnan
> <karthik.krishnan at kitware.com> wrote:
> > Add a third redundancy to it :-). vtkDelaunay2D.
>
> I have some questions about
>  void vtkTextureMapToPlane::ComputeNormal(vtkDataSet *output)
>
>
David:

Thanks for taking the time to look at this class.


> 1) why is the input called 'output'? The only thing the function does
> is set this-Normal, right? 'output' is not modified as far as I can
> tell.
>


Doesn't matter whether you call call ComputeNormal(output) or
ComputeNormal(input). The filters starts off by copying the geometry and
topology from the input to the output. See line 80 :

    output->CopyStructure( input );




> 2) the last line is
> this->Normal[2] = -1.0; // because of the formulation
>
> My normal computation will certainly not always have the z component
> of the normal = -1... why is this supposed to be the case?
>

I don't think that is meant to imply that the normal vector is [0, 0, -1].
It means that the solution to the normal is the 3 component tuple after
solving the linear system by kramer's rule :
  [A, B, -1]

The actual normal is obtained by normalizing this vector to unit norm. That
would automatically give you the solution to the z component, which need not
be -1.

thx
--
karthik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20091104/395ea8df/attachment.html>


More information about the vtk-developers mailing list