[vtk-developers] BestFitPlane function for vtkPlane

David Doria daviddoria+vtk at gmail.com
Wed Nov 4 11:36:21 EST 2009


On Wed, Nov 4, 2009 at 11:28 AM, Karthik Krishnan
<karthik.krishnan at kitware.com> wrote:
> On Wed, Nov 4, 2009 at 10:33 AM, David Doria <daviddoria+vtk 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
>
>
>

Of course it doesn't matter what you call it - but it DOES make it
more confusing :)

About the -1, I didn't see the normalization taking place inside this
function so I was confused, but it doesn't sound like there would be
any problem. I have updated both of these classes but some of my
(non-related) tests are freezing. (see my post on the users list).
François is helping me looking into it - once they are working if all
the tests that don't fail before my changes still pass I'll send the
updated files to the list for you guys to approve.

Thanks,

David



More information about the vtk-developers mailing list