<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#003333">
<big><font size="-1"><big><font face="Tahoma">Hi all,<br>
<br>
I am coding a tools to interactively select a region of a
mesh with </font></big></font><font size="-1"><big><font
face="Tahoma">vtkContourWidget</font></big></font></big><font
size="-1"><font face="Tahoma"><big>.<br>
<br>
To get this contour, I headed for vtkExtractPolyDataGeometry
and vtkImplicitLoop.<br>
<br>
Now I don't understand very well what happened : most of the
time I get extra cells which doesn't belong to the interior of
the contour.<br>
For example here :
<a class="moz-txt-link-freetext" href="http://img341.imageshack.us/img341/523/sanstitreypg.jpg">http://img341.imageshack.us/img341/523/sanstitreypg.jpg</a>, I get
the desired region + the back face of this region.<br>
<br>
Can someone explain me what's wrong with this code ?</big><br>
<br>
</font></font>// 1. close the loop if not<br>
vtkContourWidget->CloseLoop();<br>
<br>
// 2. get the contour as a polydata<br>
vtkContourRepresentation *contourRep =
reinterpret_cast<vtkContourRepresentation*>(vtkContourWidget->WidgetRep);<br>
<br>
vtkSmartPointer<vtkPoints> selectionPoints =
vtkSmartPointer<vtkPoints>::New();<br>
selectionPoints =
contourRep->GetContourRepresentationAsPolyData()->GetPoints();<br>
<br>
<br>
// 3. Pass convert the contour into vtkImplicitSelectionLoop<br>
vtkSmartPointer<vtkImplicitSelectionLoop> loop =
vtkSmartPointer<vtkImplicitSelectionLoop>::New();<br>
loop->SetLoop(selectionPoints);<br>
<br>
// 4. clip mesh with the contour<br>
vtkSmartPointer<vtkExtractPolyDataGeometry> clip =
vtkSmartPointer<vtkExtractPolyDataGeometry>::New();<br>
clip->SetImplicitFunction(loop);<br>
clip->SetInput(mesh);<br>
clip->SetExtractInside(1);<br>
clip->SetExtractBoundaryCells(1);<br>
clip->Update();<br>
<br>
Thanks by advance<br>
</body>
</html>