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

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

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

abhishek
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

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();  

Reply | Threaded
Open this post in threaded view
|

Re: How to create a surface from a group of unorganized 2-D points?

Alex Malyushytskyy
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 <[hidden email]> 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


_______________________________________________
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