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

Jean-Dominique Barnichon jeando.barnichon at free.fr
Thu Jun 12 17:08:49 EDT 2003


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