How to check if a vtkPolyData object is a closed surface

How to check if a vtkPolyData object is a closed surface

Dear mailing list members,

We want to check if our vtkPolyData surface is closed because the
normals from the output of vtkPolyDataNormals with AutoOrientNormalsOn
are not consistently pointing outwards. Strangely with
AutoOrientNormalsOff they all normals seem to be pointing outwards.
We tried vtkSelectEnclosedPoints::IsSurfaceClosed() to check if our
vtkPolyData surface is closed but that results in an error when we set
CheckSurfaceOn() and Update the filter.
Is there any other way to check if a surface is closed? It would be nice
if vtkPolyDataNormals had this functionality so that we don't need to
create some input points for vtkSelectEnclosedPoints.
Calling vtkSelectEnclosedPoints::IsSurfaceClosed() without an instance
seems not to be possible in python, or is it?

Re: How to check if a vtkPolyData object is a closed surface

If you do featureEdges->Update(), then
featureEdges->GetOutput()->GetNumberOfCells() will return the number
of open edges for the data.

The output of vtkFeatureEdges is a set of lines that correspond to the
problem edges, so you can put the output of vtkFeatureEdges into a
mapper & actor so that you can superimpose the problem edges on top of
your data set.

Re: How to check if a vtkPolyData object is a closed surface

> Hi Roman,
>
> The vtkFeatureEdges filter can check for closed surfaces. Use the
> following settings:
>
> featureEdges->FeatureEdgesOff()
> featureEdges->BoundaryEdgesOn()
> featureEdges->NonManifoldEdgesOn()
>
> If you do featureEdges->Update(), then
> featureEdges->GetOutput()->GetNumberOfCells() will return the number
> of open edges for the data.
>
> The output of vtkFeatureEdges is a set of lines that correspond to the
> problem edges, so you can put the output of vtkFeatureEdges into a
> mapper & actor so that you can superimpose the problem edges on top of
> your data set.
>
> David

> Dear mailing list members,
>
>
> We want to check if our vtkPolyData surface is closed because the
> normals from the output of vtkPolyDataNormals with AutoOrientNormalsOn
> are not consistently pointing outwards. Strangely with
> AutoOrientNormalsOff they all normals seem to be pointing outwards.
> We tried vtkSelectEnclosedPoints::IsSurfaceClosed() to check if our
> vtkPolyData surface is closed but that results in an error when we set
> CheckSurfaceOn() and Update the filter.
> Is there any other way to check if a surface is closed? It would be nice
> if vtkPolyDataNormals had this functionality so that we don't need to
> create some input points for vtkSelectEnclosedPoints.
> Calling vtkSelectEnclosedPoints::IsSurfaceClosed() without an instance
> seems not to be possible in python, or is it?
>
> Any help or hints on this are very much appreciated
> Roman
>
>

Re: How to check if a vtkPolyData object is a closed surface

> On Wed, Apr 14, 2010 at 3:44 PM, David Gobbi <[hidden email]> wrote:
>> Hi Roman,
>>
>> The vtkFeatureEdges filter can check for closed surfaces. Use the
>> following settings:
>>
>> featureEdges->FeatureEdgesOff()
>> featureEdges->BoundaryEdgesOn()
>> featureEdges->NonManifoldEdgesOn()
>>
>> If you do featureEdges->Update(), then
>> featureEdges->GetOutput()->GetNumberOfCells() will return the number
>> of open edges for the data.
>>
>> The output of vtkFeatureEdges is a set of lines that correspond to the
>> problem edges, so you can put the output of vtkFeatureEdges into a
>> mapper & actor so that you can superimpose the problem edges on top of
>> your data set.
>>
>> David
>
> Here is a short demonstration of David G's recommendation:
> http://www.vtk.org/Wiki/VTK/Examples/ClosedSurface>

Many thanks David G. for the idea and David D. for the example. With
that we managed to find the reason why our surfaces were not closed.