[vtkusers] Strange behavior in vtkPlaneSource (maybe bug?)

Marco Sambin m.sambin at gmail.com
Tue Apr 2 10:45:27 EDT 2013


Nobody on this?
Just to check if I am missing something obvious or there may be a bug in
vtkPlaneSource indeed.

Thanks for your comments.

Best regards,

Marco
 Il giorno 28/mar/2013 12:15, "Marco Sambin" <m.sambin at gmail.com> ha
scritto:

> Hi all.
>
> I am using the vtkPlaneSource class in a VTK-derived class. I noticed that
> the following simple sequence of calls:
>
> =========================
> CODE A:
>
> double newO[3];
> double newP1[3];
> double newP2[3];
> double newNormal[3];
>
> // [...] set new values...
>
> myPlaneSource->SetPoint1(newP1);
> myPlaneSource->SetPoint2(newP2);
> myPlaneSource->SetOrigin(newO);
> myPlaneSource->GetNormal(newNormal);
> =========================
>
> finally returns a normal which seems INCORRECT to me.
> On the other side, the following sequence of calls (which differs from
> CODE A in the position of the SetOrigin() call):
>
> =========================
> CODE B:
>
> double newO[3];
> double newP1[3];
> double newP2[3];
> double newNormal[3];
>
> // [...] set new values...
>
> myPlaneSource->SetOrigin(newO);
> myPlaneSource->SetPoint1(newP1);
> myPlaneSource->SetPoint2(newP2);
> myPlaneSource->GetNormal(newNormal);
> =========================
>
> finally returns a normal which seems CORRECT.
> After taking a look at vtkPlaneSource.cxx source, I believe that the
> problem is that while the implementation of the SetPoint1() and SetPoint2()
> methods finally calls UpdatePlane(), which also updates the normal, the
> implementation of SetOrigin() does not update the normal. Hence, if
> SetOrigin() is the last call, the resulting normal is incorrect in my
> opinion.
>
> Can you please comment?
> Thanks in advance,
>
> Marco
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130402/97bcd572/attachment.htm>


More information about the vtkusers mailing list