[vtkusers] using vtkImplicitFunction in two ways to clip a cylinder

Dean Inglis dean.inglis at camris.ca
Tue May 3 13:48:45 EDT 2011


Hi David,

with vtkPlane as an implicit function, EvaluateFunction is a continuous
scalar function that returns the dot product of the plane normal
with the vector defined by the test point and the plane origin: in plane
points from an orthogonal vector to the normal and hence a 0 value is 
returned,
otherwise the magnitude of the projection of the resulting vector on the
normal is returned.
With vtkImplicitData set, if all of its scalar values are a constant, say 1,
then a point on the data set, if it is a surface, will return a 1 and 
OutValue
otherwise: hence a delta function.  Either way, one knows if a test point
is on or off the surface.  In the latter case, one has no indication of
"how close".  Why do filters like vtkClipPolyData and vtkCutter need
a measure of (for lack of a better term ) "closeness" ?

Would having a modified vtkImplicitDataSet work if the data set
were required to return a continuous value in the case when the
the test point didnt evaluate to being on the surface (maybe using surface
normals somehow)?

thanks,
Dean


----- Original Message ----- 
From: "David Gobbi" <david.gobbi at gmail.com>
To: "Dean Inglis" <dean.inglis at camris.ca>
Cc: <vtkusers at vtk.org>
Sent: Tuesday, May 03, 2011 1:20 PM
Subject: Re: [vtkusers] using vtkImplicitFunction in two ways to clip a 
cylinder


Hi Dean,

I get the feeling that you are looking for something similar to
vtkImplicitSelectionLoop for polydata surfaces.  No such thing exists
in VTK, that is why there is so many people have expressed interest
in the VTK Journal submission that clips polydata with polydata.

The way vtkImplicitDataSet works is similar to vtkImplicitVolume.  The
implicit value is interpolated from the data, and everywhere outside
the data has a value of OutValue.  So clipping with vtkImplicitDataSet
works well if the cells are volumetric, but if the cells are 2D, then you
end up with something akin to a delta function.

 - David


On Tue, May 3, 2011 at 10:48 AM, Dean Inglis <dean.inglis at camris.ca> wrote:
> Im having a problem getting a proof of principle established
> that demonstates clipping with vtkClipPolyData using vtkImplicitDataSet.
> I would ultimately like to clip a vtkPolyData with an arbitrary
> (non-parametric)
> surface defined by vtkPolyData composed of 2D cells (vtkTriangle,
> vtkTriangleStrip
> etc.). I have coded two simple demos in tcl: one uses a vtkPlane as the
> vtkImplicitFunction and is controlled interactively with
> vtkImplicitPlaneWidget,
> the other uses a vtkPolyData output from a vtkPlaneWidget. In the latter
> case
> I am using vtkImplicitDataSet as the function by assigning a scalar array
> (of 1's) to the
> polydata, but no clipping occurs. Can anyone offer suggestion on how to 
> get
> the latter demo working?
>
> best,
> Dean 




More information about the vtkusers mailing list