[vtkusers] How to create a surface from a group of unorganized 2-D points?

Alex Malyushytskyy alexmalvtk at gmail.com
Fri Jul 26 17:40:17 EDT 2013


I do not think you can unless you can manually specify connections.
vtkDelaunay will create a convex polygon.
This is unique.

Points inside means that original polygon was not convex an there is
multiple possible solution.

Just look at the points below

 *              *
        *

*              *

There are at least 4 different  polygons you can create depending on how
you connect internal point.


Regards,
    Alex





On Fri, Jul 26, 2013 at 1:22 AM, abhishek <abhishek at meddiff.com> wrote:

> Hello user,
>
> I want to create a surface from a group of unorganized 2-D points.
>
> As seen in the attached figure, I am able to generate a surface but some
> points(in red) are inside the surface.
>
> surface.png <http://vtk.1045678.n5.nabble.com/file/n5722255/surface.png>
>
> How can I create surface such that all points lie on the edge and not
> inside?
>
> This is what my code looks like:
> // Add the grid points to a polydata object
> vtkSmartPointer<vtkPolyData> polydata =
> vtkSmartPointer<vtkPolyData>::New();
> polydata->SetPoints(orgPoints);
>
> // create geometry.
> vtkSmartPointer<vtkVertexGlyphFilter> glyphFilter =
> vtkSmartPointer<vtkVertexGlyphFilter>::New();
> glyphFilter->SetInputConnection(polydata->GetProducerPort());
> glyphFilter->Update();
> glyphFilter->GetOutput()->Print(cout);
>
>
>
> //delunay
> // Create the convex hull of the pointcloud
> vtkSmartPointer<vtkDelaunay2D> delaunay = vtkSmartPointer< vtkDelaunay2D
> >::New();
> delaunay->SetInput(glyphFilter->GetOutput());
> delaunay->SetTolerance(0.01);
> delaunay->Update();
>
> vtkSmartPointer<vtkDataSetSurfaceFilter> surfaceFilter =
> vtkSmartPointer<vtkDataSetSurfaceFilter>::New();
> surfaceFilter->SetInputConnection(delaunay->GetOutputPort());
> surfaceFilter->Update();
>
>
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/How-to-create-a-surface-from-a-group-of-unorganized-2-D-points-tp5722255.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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130726/ca4987ce/attachment.htm>


More information about the vtkusers mailing list