[vtkusers] random sampling of polydata

David Doria daviddoria at gmail.com
Fri Nov 12 17:35:15 EST 2010


On Fri, Nov 12, 2010 at 4:21 PM, Elvis Chen <elvis.chen at gmail.com> wrote:
> hi all,
> I have a triangular mesh in vtkpolydata format.  What I like to do it to
> generate another mesh (or even just point clouds) with points that were
> randomly sampled from the original mesh.  The sampling method doesn't have
> to be spatially uniform.  Is there a vtk filter that performs this task?
> any help is very much appreciated

This will pick you out random points of the polydata:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/MaskPoints

of course you'd have to bring the cells along with it, using something
like this:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractCellsUsingPoints

I'm not sure what your goal is, but you could also use a decimation
technique if you are just trying to approximately preserve the
structure:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/QuadricClustering
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/QuadricDecimation

David



More information about the vtkusers mailing list