Quantcast

How to check if a vtkPolyData object is a closed surface

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to check if a vtkPolyData object is a closed surface

Roman Grothausmann
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


--
Roman Grothausmann

Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
Bereich Funktionale Materialien
Institut für angewandte Materialforschung
Hahn-Meitner-Platz 1
D-14109 Berlin

Tel.: +49-(0)30-8062-2816
Fax.: +49-(0)30-8062-3059

Vorsitzender des Aufsichtsrats: Prof. Dr. Dr. h.c. mult. Joachim Treusch
Stellvertretende Vorsitzende: Dr. Beatrix Vierkorn-Rudolph
Geschäftsführer: Prof. Dr. Anke Rita Kaysser-Pyzalla, Prof. Dr. Dr. h.c.
Wolfgang Eberhardt, Dr. Ulrich Breuer
Sitz der Gesellschaft: Berlin
Handelsregister: AG Charlottenburg, 89 HRB 5583

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

David Gobbi
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


On Wed, Apr 14, 2010 at 6:35 AM, Roman Grothausmann
<[hidden email]> wrote:

> 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
>
>
> --
> Roman Grothausmann
>
> Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
> Bereich Funktionale Materialien
> Institut für angewandte Materialforschung
> Hahn-Meitner-Platz 1
> D-14109 Berlin
>
> Tel.: +49-(0)30-8062-2816
> Fax.: +49-(0)30-8062-3059
>
> Vorsitzender des Aufsichtsrats: Prof. Dr. Dr. h.c. mult. Joachim Treusch
> Stellvertretende Vorsitzende: Dr. Beatrix Vierkorn-Rudolph
> Geschäftsführer: Prof. Dr. Anke Rita Kaysser-Pyzalla, Prof. Dr. Dr. h.c.
> Wolfgang Eberhardt, Dr. Ulrich Breuer
> Sitz der Gesellschaft: Berlin
> Handelsregister: AG Charlottenburg, 89 HRB 5583
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

David Doria-2
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

Thanks,

David D.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Jorge Ballesteros-2
In reply to this post by Roman Grothausmann
Hi Roman,

You may want to take look at the vtkFeatureEdges Filter.

In VTK Examples:

http://www.cmake.org/Wiki/VTK/Examples/ClosedSurface




Roman Grothausmann wrote:

> 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
>
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Roman Grothausmann
In reply to this post by David Doria-2
David Doria wrote:

> 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.

Thanks a lot
Roman


--
Roman Grothausmann

Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
Bereich Funktionale Materialien
Institut für angewandte Materialforschung
Hahn-Meitner-Platz 1
D-14109 Berlin

Tel.: +49-(0)30-8062-2816
Fax.: +49-(0)30-8062-3059

Vorsitzender des Aufsichtsrats: Prof. Dr. Dr. h.c. mult. Joachim Treusch
Stellvertretende Vorsitzende: Dr. Beatrix Vierkorn-Rudolph
Geschäftsführer: Prof. Dr. Anke Rita Kaysser-Pyzalla, Prof. Dr. Dr. h.c.
Wolfgang Eberhardt, Dr. Ulrich Breuer
Sitz der Gesellschaft: Berlin
Handelsregister: AG Charlottenburg, 89 HRB 5583

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

David Doria-2
> 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.
>
> Thanks a lot
> Roman

I'm glad to see it is resolved. Just for the record, yesterday I
noticed that there is a:

vtkSelectEnclosedPoints::CheckSurfaceOn( )

http://www.vtk.org/doc/nightly/html/classvtkSelectEnclosedPoints.html#a51efa8165c7ccad95eb592db3a0e59f8

That explicitly checks if a surface is closed.

I don't know if it would be easy to extract that code, but it may be
worth looking into for anyone interested in surface closure.

Thanks,

David
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Loading...