[vtk-developers] howto report a bug?

Will Schroeder will.schroeder at kitware.com
Fri Oct 5 12:40:41 EDT 2012


One approach is to just add an option to the class which indicates whether
the take the sqrt or not. Leave the default behavior alone or you'll be
driving a lot of people nuts :-)
W

On Fri, Oct 5, 2012 at 12:09 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> I think the root of the problem is vtkSphere.  Here is the function
> that it uses:
>
>   return ( ((x[0] - this->Center[0]) * (x[0] - this->Center[0]) +
>               (x[1] - this->Center[1]) * (x[1] - this->Center[1]) +
>               (x[2] - this->Center[2]) * (x[2] - this->Center[2])) -
>               this->Radius*this->Radius );
>
> It is computing the squared distance from the surface of the sphere.
> This is different from vtkPlane, which computes the linear distance
> from the plane.  This is definitely going to cause scaling problems
> when you combine these two functions with vtkImplicitBoolean.
>
> VTK's clipping and contouring operations work by doing linearly
> interpolating the scalar value along each edge or line segment that is
> clipped.  In order for the clipping to be done accurately, the
> implicit functions must return a signed linear distance from the
> surface that the implicit function defines.  Because vtkSphere is
> returning a squared distance, I have to declare that vtkSphere is
> broken.
>
> It should be using a formula like this:
>
>   double d2 = (dx*dx + dy*dy + dz*dz - r*r);
>   return (d2 < 0 ? -sqrt(-d2) : sqrt(d2));
>
> This will make vtkSphere a bit slower, but it will make it give better
> results.
>
>  - David
>
>
> On Thu, Oct 4, 2012 at 5:05 PM, Sebastien Jourdain
> <sebastien.jourdain at kitware.com> wrote:
> > Ok then, could you save the 2 output of the vtkSampleFunction to a
> > binary vtk file format and upload them to the bug tracker, so I can
> > try to clip the dataset inside ParaView.
> >
> > Thanks,
> >
> > Seb
> >
> > On Thu, Oct 4, 2012 at 6:51 PM, Henning Meyer <tutmann at gmail.com> wrote:
> >>> But I don't think the issue come from the contour filter. Did you
> >>> tried to just render the SampleFunction ?
> >> It looks almost the same in both cases - besides the 1000 * value range
> in
> >> the second example.
> > _______________________________________________
> > 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
> >
> _______________________________________________
> 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
>
>


-- 
William J. Schroeder, PhD
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
will.schroeder at kitware.com
http://www.kitware.com
(518) 881-4902
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20121005/1a92ff40/attachment.html>


More information about the vtk-developers mailing list