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

David Gobbi david.gobbi at gmail.com
Mon Feb 14 14:58:34 EST 2011


Hi Karthik,

It seems that a better solution would be to add a new filter to VTK
that can cut one polydata with another polydata.  Since the contouring
operations are built into the cell classes, this could be done with
almost no code overlap with vtkCutter.

 - David

On Mon, Feb 14, 2011 at 11:23 AM, Karthik Krishnan
<karthik.krishnan at kitware.com> wrote:
> 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
>
>



More information about the vtk-developers mailing list