[vtk-developers] Generated normals not present in the polydata from unknown reason.

Jana Sefcikova neollie at gmail.com
Sun May 6 19:20:33 EDT 2012


Hi all,
I figured out my bug. The result was correct, my expectation false.
Variable polydata in main context should not contain normals.
There is pointer assignement to local pointer copy of polydata inside
function
polydata = normalGenerator->GetOutput();
instead of instance assignement, I looked thorugh it.

Have a nice day
Jana

On 20 April 2012 19:15, Jana Sefcikova <neollie at gmail.com> wrote:

> Hi Bill,
> thanks for response, but normalGenerator is updated before assignement in
> original code as you propose.
>
> On 20 April 2012 16:34, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>
>> Oops...
>> Try
>> normalGenerator->Update();
>>  before
>> polydata = normalGenerator->GetOutput();
>>
>>
>> On Fri, Apr 20, 2012 at 10:33 AM, Bill Lorensen <bill.lorensen at gmail.com>
>> wrote:
>> > Try
>> > normalGenerator-Update();
>> > before
>> > polydata = normalGenerator->GetOutput();
>> >
>> >
>> > On Fri, Apr 20, 2012 at 10:30 AM, Jana Sefcikova <neollie at gmail.com>
>> wrote:
>> >> Dear Users,
>> >> I tested vtk example PolyDataExtractNormals
>> >> (
>> http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataExtractNormals)
>> >> code that tries to detect whether normals are present in input polydata
>> >> structure and if not it will generate them. I made small change to
>> code  at
>> >> the end of the main function in order to run TestPointNormal twice so
>> I have
>> >> :
>> >>
>> >>   std::cout << "PolyData address: " << polydata << std::endl;
>> >>   TestPointNormals(polydata);
>> >>
>> >>   TestPointNormals(polydata);
>> >>
>> >> I expected that after first round the polydata will be changed and will
>> >> contain new array for "Normals"  because output of normal generator is
>> >> assigned to input polydata in the first round / polydata =
>> >> normalGenerator->GetOutput(); /
>> >> so second  test round should pass directly without normal generation.
>> >> But after the firt test, polydata normals are not present any more so
>> second
>> >> Test generate them  again .
>> >> So my question is : Why normals dissapeared ?
>> >> The same confusion for me occured when I enabled splitting on normal
>> >> generator (normalGenerator->SetSplitting(1);).  Inside first
>> >> TestPointNormals polydata had more points as before at the end (due to
>> >> splitting), but second test again work on likely unchanged polydata.
>> >>
>> >> Why two functions working on the same pointer that is changed inside
>> each
>> >> call looks unchanged ?
>> >>
>> >> Thanks for any advice.
>> >>
>> >>
>> >>
>> >>
>> >> _______________________________________________
>> >> Powered by www.kitware.com
>> >>
>> >> Visit other Kitware open-source projects at
>> >> http://www.kitware.com/opensource/opensource.html
>> >>
>> >> Follow this link to subscribe/unsubscribe:
>> >> http://www.vtk.org/mailman/listinfo/vtk-developers
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > Unpaid intern in BillsBasement at noware dot com
>>
>>
>>
>> --
>> Unpaid intern in BillsBasement at noware dot com
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20120507/2b28c8a8/attachment.html>


More information about the vtk-developers mailing list