[vtkusers] vtkClipClosedSurface problem

David Gobbi david.gobbi at gmail.com
Fri Mar 30 16:32:15 EDT 2012


Hi Randy,

It's not tricky, its picky, as in picky about its input.  Use
vtkFeatureEdges as I mentioned in my earlier email to test your data
to verify that it will work.  You might find some interesting things
about your data if you do so.

The vtkClipClosedSurface code uses a different clipping algorithm as
compared to vtkClipPolyData.  The latter uses a vtkPointLocator to
generate its output... this is a bit sloppy, because the point locator
can sometimes merges points that shouldn't be merged, but it is
forgiving, and doesn't require anything special about its input.  On
the other hand, vtkClipClosedSurface does not use a vtkPointLocator,
instead it uses an algorithm that will never accidentally merge points
and therefore won't accidentally modify the topology of the data.  In
other words, given a manifold surface as input, it will give a
manifold surface as output, which is something that vtkClipPolyData
cannot guarantee.

 - David



On Fri, Mar 30, 2012 at 2:11 PM, Randy Heiland <heiland at indiana.edu> wrote:
> Sadly, the vtkCleanPolyData seems to only fix the problem some of the time.  I updated that web page to show another test case.  In addition to cleaning the output of the superquadsource, I also tried cleaning the output of the glyphs themselves, but it didn't seem to help.  The ClipClosedSurface seems to be one tricky filter.
>
> -Randy
>
> On Mar 29, 2012, at 10:36 PM, David Gobbi wrote:
>
>> Hi Randy,
>>
>> I tried it with vtkSphereSource and it worked perfectly.  Evidently
>> vtkSuperquadricSource does not generate a closed surface.  You can
>> test whether a surface is closed by using the vtkFeatureEdges filter
>> to display free edges, i.e. edges that belong to only one polygon.
>> In a closed surface, each edge belongs to exactly two polygons.
>>
>> feature = vtk.vtkFeatureEdges()
>> feature.SetInputConnection(glyphs.GetOutputPort())
>> feature.FeatureEdgesOff()
>> feature.BoundaryEdgesOn()
>> feature.NonManifoldEdgesOn()
>>
>> Try vtkCleanPolyData to clean the output of vtkSuperquadricSource.
>> It isn't guaranteed to work, but it's worth a shot.
>>
>> - David
>>
>>
>> On Thu, Mar 29, 2012 at 6:27 PM, Randy Heiland <heiland at indiana.edu> wrote:
>>> Hi,
>>>
>>> I'm having a problem with this filter and would welcome any advice.  I've got a self-contained example here:
>>>
>>> http://old.compucell3d.org/mediawiki1.7/index.php/Vtk_clip_cap_glyphs
>>>
>>> thanks, Randy
>



More information about the vtkusers mailing list