[vtkusers] How to determine if a loop is closed or not

Mathieu Malaterre mathieu.malaterre at kitware.com
Thu Jan 29 09:59:15 EST 2004


Shyam,

	This mail has a perfect format :) thanks
	In your pipeline you can do something like:

	vtkFeatureEdges *boundaryEdges = vtkFeatureEdges::New();
	boundaryEdges->SetInput(meshin);
	boundaryEdges->SetBoundaryEdges(1);
	boundaryEdges->SetFeatureEdges(0);
	boundaryEdges->SetNonManifoldEdges(0);
	boundaryEdges->SetManifoldEdges(0);

	vtkCleanPolyData *boundaryClean = vtkCleanPolyData::New();
	boundaryClean->SetInput(boundaryEdges->GetOutput());

	vtkStripper *boundaryStrips = vtkStripper::New();
	boundaryStrips->SetInput(boundaryClean->GetOutput());
	boundaryStrips->Update();  //very important

vtkPolyData *boundaryPoly = vtkPolyData::New();
boundaryPoly->SetPoints(boundaryStrips->GetOutput()->GetPoints());
boundaryPoly->SetPolys(boundaryStrips->GetOutput()->GetLines());

	And here you'll have either an empty polydata or a polydata containing 
only closed line.

I found it here :
http://vtk.org/pipermail/vtkusers/2000-May/011093.html

HTH
Mathieu

Shyam Prakash wrote:
> Mathieu,
> 
> 
>>	You can use vtkFeaturesEdges for this.
> 
> 
> 	Sorry for the mail format problem. I use vtkFeatureEdges to
> extract the special type of edges from my polydata. But I am not sure
> how to use this class to find out if a polygon is closed or not. Can you
> please give me an example.
> 
> Thanks
> Shyam
> 
> 
> 
>>Thanks
>>Mathieu
>>
>>
>>Hi,
>>             I have a set of vtkLine cell types which form a loop
> 
> (like
> 
>>circle or ellipse etc. which may be closed or not). I want to find out
>>is this loop is closed or not. Does any body know how this can be
>>determined.
>>
>>Thanks
>>Shyam
> 
> 
> 






More information about the vtkusers mailing list