[vtkusers] RE: How to transform the result of vtkFeatureEdges in a single polyline?

Jean-Dominique Barnichon jeando.barnichon at free.fr
Fri Jun 13 08:58:58 EDT 2003


Sorry,
I've found the solution on my own ..., which is the filter vtkStripper.
Jean-Do

> -----Message d'origine-----
> De : Jean-Dominique Barnichon [mailto:jeando.barnichon at free.fr]
> Envoyé : jeudi 12 juin 2003 23:09
> À : vtkusers at public.kitware.com
> Objet : How to transform the result of vtkFeatureEdges in a single
> polyline?
>
>
> Hi,
>
> after a performing a constrained vtkDelaunay2D, I extract the outer
boundary of the mesh using the > vtkFeatureEdges filter. As a result, I
obtain the mesh boundary described as a sum of all
> the  boundary segments (edges).
>
> I need to transform all these segments in a single polyline, which would
require to :
> 	- sort the segments in a consecutive order,
> 	- remove duplicate points.
> Does anybody know if an existing vtk filter could do the job?
>
> Thanks
> Jean-Do
>
> // Create the input data (points and constrained lines)
> vtkPolyData *MntData = vtkPolyData::New();
> MntData->SetPoints(m_pMeshPoints);
> MntData->SetLines(m_pLines);
> MntData->Update();
>
> // Apply vtkDelaunay2D filter
> vtkDelaunay2D *Del = vtkDelaunay2D::New();
> Del->SetInput(MntData);
> Del->SetSource(MntData);
> Del->BoundingTriangulationOff();
> Del->SetTolerance(0.001);
> Del->SetAlpha(0.0);
> Del->Update();
>
> // Get output data
> vtkPolyData *MeshData = vtkPolyData::New();
> MeshData = Del->GetOutput();
> MeshData->Update();
>
> // Apply vtkFeatureEdges filter to Extract the boundary from the output
data
> vtkFeatureEdges *fe = vtkFeatureEdges::New();
> fe->SetInput(MeshData);
> fe->ManifoldEdgesOff();
> fe->NonManifoldEdgesOff();
> fe->FeatureEdgesOff();
> fe->BoundaryEdgesOn();
>
> // Get the boundary data
> vtkPolyData *BoundaryData = vtkPolyData::New();
> BoundaryData = fe->GetOutput();
> BoundaryData ->Update();





More information about the vtkusers mailing list