[vtk-developers] Implicit functions - Ability to specify if it is evaluable

Karthik Krishnan karthik.krishnan at kitware.com
Mon Feb 14 13:23:03 EST 2011


Thanks for the replies. Perhaps a screenshot would help clarify.

The first screenshot is CutAfterModification-vtkCutter.png. The implicit
function here is a polyplane, (function at a given point evaluates to the
signed distance to the plane). It the point is beyond the "extent" of the
plane, its returns an "outside" value.

- If one extends the function to infinity, as David suggests, one cuts
through the entire dataset. This is not what I want.
- If one returns any arbitrary value, say a large positve or negative value,
outside the extents of the plane, one ends up with artefacts when contouring
with vtkCutter as seen in the second screenshot.

To summarize:
- I agree, I does change the definition a bit, but one can't do something as
simple as cut a dataset with finite plane.
- Adding one boolean evaluation is negligible compared to the function
evaluation. It may even be faster, if one doesn't have to evaluate points if
the function isn't defined.

I did modify the code already, in my repository..
Its the modification to vtkCutter that I am proposing, to ignore contouring
cells that contain points with a certain value/attribute. There'd be no
modification to vtkImplicitFunction then.

I guess we'll do it another way then..

Thanks
--
karthik
(sorry for the repost.. my reply bounced with the image attachemtns)

On Mon, Feb 14, 2011 at 10:56 PM, Will Schroeder <will.schroeder at kitware.com
> wrote:

> An implicit function is f(x,y,z) = constant. If it doesn't fit that IMO
> it's not an implicit function. The beauty of these beasts is that they are
> simple, now you want to complexify the matter by checking validity on every
> point, it would likely slow everything down, not to mention require
> modifying a lot of code to do it right.
>
> I think you need a new design not a new hack ;-)
>
> W
>
> On Mon, Feb 14, 2011 at 12:04 PM, Karthik Krishnan <
> karthik.krishnan at kitware.com> wrote:
>
>> Hello:
>>
>> I need to cut a dataset with a polyplane. So I wrote a vtkPolyPlane class
>> that derives from vtkImplicitFunction; so one could use it in combination
>> with a vtkCutter.
>>
>> It does not quite work, unless the polyplane is infinite in extent. What I
>> need is a way for the implicit function to specify that it cannot be defined
>> at a certain point. The hack I have now is for the Evaluate method to return
>> VTK_DOUBLE_MAX and a modification to vtkCutter to avoid contouring any cells
>> which contain a point where the evaluated function value is VTK_DOUBLE_MAX.
>>
>> I propose
>> - Adding a IsDefined method to vtkImplicitFunction that returns true by
>> default (subclasses may override it)
>> - Modifying vtkCutter to query IsDefined() on points in a cell before
>> attempting to contour a cell.
>>
>> Any thoughts.
>>
>> Thanks
>> --
>> karthik
>>
>> _______________________________________________
>> 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/20110214/601b2170/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CutAfterMod-vtkCutter.jpg
Type: image/jpeg
Size: 20845 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110214/601b2170/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Before_Mod.jpg
Type: image/jpeg
Size: 17941 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110214/601b2170/attachment-0003.jpg>


More information about the vtk-developers mailing list