ClipClosedSurface

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

ClipClosedSurface

Laurent
Dear users,

I would like to clip data using ClipClosedSurface and get the generated cells (the cap).
I saw in the doxygen that you can Setup a flag using SetScalarModeToLabels that will generate scalar data for that cells (1 for the cut face and 2 for the active plane, 0 for the original cells).
That seems perfect for me but this is not implemented in my version (VTK  5.6.1).
I tried to download the vtkClipClosedSurface class from Git but there is no ScalarMode in that clas...
I've found CellClipScalars vtkDoubleArray that seems to be the interesting data, but it is not used.

Does someone knows if this option is really available and how to use it (Name of the scalar Array for a latter use, ...)?

Thanks,
Laurent.
Reply | Threaded
Open this post in threaded view
|

Re: ClipClosedSurface

David Gobbi
Hi Laurent,

I am glad to hear that you are interested in this class.  I'm not sure
what went wrong when you tried to download it from git, but the
versions of this class in the git master and release branches both
have SetScalarModeToLabels.  This class will be part of VTK 5.8.

When SetScalarModeToLabels is used, the array is called "Labels"
(you cannot change the name).  More documentation can be found
here: http://www.vtk.org/Wiki/VTK/Closed_Surface_Clipping

 - David


On Tue, Aug 2, 2011 at 9:35 AM, Laurent <[hidden email]> wrote:

> Dear users,
>
> I would like to clip data using ClipClosedSurface and get the generated
> cells (the cap).
> I saw in the doxygen that you can Setup a flag using SetScalarModeToLabels
> that will generate scalar data for that cells (1 for the cut face and 2 for
> the active plane, 0 for the original cells).
> That seems perfect for me but this is not implemented in my version (VTK
> 5.6.1).
> I tried to download the vtkClipClosedSurface class from Git but there is no
> ScalarMode in that clas...
> I've found CellClipScalars vtkDoubleArray that seems to be the interesting
> data, but it is not used.
>
> Does someone knows if this option is really available and how to use it
> (Name of the scalar Array for a latter use, ...)?
>
> Thanks,
> Laurent.
_______________________________________________
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
|

Re: ClipClosedSurface

Laurent
Hi David,

I think that this class is a great improvement for VTK as well as the
class published in the Insight Journal called "Boolean Operations on
Surfaces in VTK Without External Libraries"

I don't know what happened when I have downloaded the clss from git, but
I have retried and I finally get the class containing the ScalarMode.
I"ll try that tomorrow.
Thanks,
Laurent.


Le 2/08/2011 17:55, David Gobbi a écrit :

> Hi Laurent,
>
> I am glad to hear that you are interested in this class.  I'm not sure
> what went wrong when you tried to download it from git, but the
> versions of this class in the git master and release branches both
> have SetScalarModeToLabels.  This class will be part of VTK 5.8.
>
> When SetScalarModeToLabels is used, the array is called "Labels"
> (you cannot change the name).  More documentation can be found
> here: http://www.vtk.org/Wiki/VTK/Closed_Surface_Clipping
>
>   - David
>
>
> On Tue, Aug 2, 2011 at 9:35 AM, Laurent<[hidden email]>  wrote:
>> Dear users,
>>
>> I would like to clip data using ClipClosedSurface and get the generated
>> cells (the cap).
>> I saw in the doxygen that you can Setup a flag using SetScalarModeToLabels
>> that will generate scalar data for that cells (1 for the cut face and 2 for
>> the active plane, 0 for the original cells).
>> That seems perfect for me but this is not implemented in my version (VTK
>> 5.6.1).
>> I tried to download the vtkClipClosedSurface class from Git but there is no
>> ScalarMode in that clas...
>> I've found CellClipScalars vtkDoubleArray that seems to be the interesting
>> data, but it is not used.
>>
>> Does someone knows if this option is really available and how to use it
>> (Name of the scalar Array for a latter use, ...)?
>>
>> Thanks,
>> Laurent.
_______________________________________________
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
|

Re: ClipClosedSurface

Laurent
David,

Great job!
It works lovely ;-)
Laurent.
Reply | Threaded
Open this post in threaded view
|

Re: ClipClosedSurface

Laurent
In reply to this post by David Gobbi
Hi David, Hi all,

I have met an issue using ClipClosedSurface.
I need to compute areas from cut meshes. The meshes are cut by a plane, and I want to compute the clipped areas. ClipCLosedSurface works well on the original meshes, perfect. The issue is when I want to compute the common surface from two meshes.
I have computed the intersection between both meshes, and I have applied ClipClosedSurface using the same plane. The generated surface is not correct. The generation stops at the junction between mesh1 and mesh2, but I don't know why.
I have looked at the wiki page and found some problems to be solved in the future. Do you think it is related?

Thanks,
Laurent.
Reply | Threaded
Open this post in threaded view
|

Re: ClipClosedSurface

David Gobbi
Hi Laurent,

ClipClosedSurface requires its input to be fully connected.  If a mesh
is not properly connected, you can sometimes build the connections
with vtkCleanPolyData.

You can test the connectivity of a mesh with vtkFeatureEdges: a closed
and fully connected surface will have no BoundaryEdges and no
NonManifoldEdges.

 - David

On Fri, Sep 2, 2011 at 4:18 AM, Laurent <[hidden email]> wrote:

> Hi David, Hi all,
>
> I have met an issue using ClipClosedSurface.
> I need to compute areas from cut meshes. The meshes are cut by a plane, and
> I want to compute the clipped areas. ClipCLosedSurface works well on the
> original meshes, perfect. The issue is when I want to compute the common
> surface from two meshes.
> I have computed the intersection between both meshes, and I have applied
> ClipClosedSurface using the same plane. The generated surface is not
> correct. The generation stops at the junction between mesh1 and mesh2, but I
> don't know why.
> I have looked at the wiki page and found some problems to be solved in the
> future. Do you think it is related?
>
> Thanks,
> Laurent.
_______________________________________________
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
|

Re: ClipClosedSurface

Laurent
This post was updated on .
Hi David,

Thanks for the advices. I'll try these.
I have also found out that the problem may be related to scalar data arrays embedded in the PolyData because when I apply ClipClosedSurface on a vtk file in paraview, the surface is badly generated and when I try it on a stl file of the same mesh, the surface is correctly generated.
I have looked for a data array in the sources of ClipClosedSurface, but I haven't found any name for the internally used arrays. The intersection produces these Arrays: Distance (on points), Distance (on cells), PointSource, CellSource

I've just just removed all the dataArrays, and the result is identical.
I test Cleanning the PolyData.

I'll keep you posted.

Thanks,
Laurent.
Reply | Threaded
Open this post in threaded view
|

Re: ClipClosedSurface

David Gobbi
ClipClosedSurface ignores the point scalars, in fact it does not even
pass them to the output unless PassPointData is on.  It generates
cell scalars with the name "Labels" or "Colors" if you called
SetScalarModeToLabels() or SetScalarModeToColors().

In any case, your initial problem was almost certainly caused by
connectivity issues.  Try vtkCleanPolyData and let me know if it
helps.  You can also try vtkTriangleFilter, since an STL file contains
only triangles and no other kinds of polys.

 - David

On Fri, Sep 2, 2011 at 5:47 AM, Laurent <[hidden email]> wrote:

> Hi David,
>
> Thanks for the advices. I'll try these.
> I have also found out that the problem may be related to scalar data arrays
> embedded in the PolyData because when I apply ClipClosedSurface on a vtk
> file in paraview, the surface is badly generated and when I try it on a stl
> file of the same mesh, the surface is correctly generated.
> I have looked for a data array in the sources of ClipClosedSurface, but I
> haven't found any name for the internally used arrays. The intersection
> produces these Arrays: Distance (on points), Distance (on cells),
> PointSource, CellSource
> Do you have a suggestion?
>
> I'll keep you posted.
>
> Thanks,
> Laurent.
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/ClipClosedSurface-tp4659117p4762052.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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
|

Re: ClipClosedSurface

Laurent
Hi David!

It works!
I have displayed the boundaries, non manifold and features Edges using the FeatureEdgeFilter in paraview.
The boolean filter produces a closed mesh, but with multiple parts.
I used CleanPolyData as you advised me, and it has created new connections between parts!
So ClipCLosedSurface is now working on my data.

Thanks for your help, it's great!
Laurent.