Re: Extracting boundary points from an unstructured grid

Cory Quammen via vtkusers <[email protected]> Tue, 5 Mar 2019 08:47:31 -0500
Newsgroups gmane.comp.lib.vtk.user
Message-ID <CAB5Fpx7S-8bZnc6LpzeuE+yPk7=6FTN9Dc6+BfxXhqF2qKnmXA@mail.gmail.com>
Hi Zoltan,

Would you mind posting your question to https://discourse.vtk.org?
Community support for VTK is transitioning to that forum, so you may be
more likely to get an answer there.

Thanks,
Cory

On Tue, Mar 5, 2019 at 5:52 AM Zoltan Kovacs <[email protected]>
wrote:

> Dear all,
>
>
>
> I try to extract the boundary nodes of an unstructured grids. Based on the
> example
>
> https://vtk.org/Wiki/VTK/Examples/Cxx/Meshes/BoundaryEdges
>
> I used the following code:
>
>
>
> vtkSmartPointer<vtkUnstructuredGrid> grid =
> vtkSmartPointer<vtkUnstructuredGrid>::New();
>
> vtkSmartPointer<vtkDataSetSurfaceFilter> filter =
> vtkSmartPointer<vtkDataSetSurfaceFilter>::New();
>
> vtkSmartPointer<vtkFeatureEdges> edges =
> vtkSmartPointer<vtkFeatureEdges>::New();
>
>
>
> /* load mesh into grid */
>
> ...
>
>
>
> /* extract the boundary points */
>
>
>
> filter->SetInputData(grid);
>
> filter->Update();
>
> edges->SetInputData(filter->GetOutput());
>
> edges->BoundaryEdgesOn();
>
> edges->FeatureEdgesOff();
>
> edges->NonManifoldEdgesOff();
>
> edges->ManifoldEdgesOff();
>
> edges->Update();
>
>
>
> vtkSmartPointer<vtkPolyData> polyData =  edges->GetOutput();
>
>
>
>
>
> When I print out the number of the points in polydata
> (polydata->GetNumberOfPoints()) I obtain 0, i.e.
>
> polydata is empty. When I comment out the lines
>
>
>
> edges->NonManifoldEdgesOff();
>
> edges->ManifoldEdgesOff()
>
>
>
> then I get some subset of points in polydata extrated from the grid but
> when I visualize these points I see that some boundary points are missing
> and there are some inner nodes in polydata. Thus
>
> polydata does not contain the exact set of the boundary points of the
> grid.
>
> Now I am not sure if this is the correct way to extract the boundary
> points from an unstructured grid
>
> and I would like to ask if there is any. Thank you very much for your help!
>
>
>
> Kind regards,
>
> Zoltan
>
>
>
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtkusers
>


-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.

_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers