Do you want edges of all the polys? Or just an outer outline of the entire construct? <br><br>If the outer outline is what you want, have you tried the vtkFeatureEdges filter?<br><br>I tried this just now in Paraview (it's great for experimenting with this kind of stuff, as it's based on VTK). I loaded an Unstructured Grid with all 2D cells. I had to use an "Extract Surface" (vtkDataSetSurfaceFilter) to get it into a vtkPolyData format, but then I could use the "Feature Edges" (vtkFeatureEdges) filter. Turn off all options except "Boundary Edges", and voila.
<br><br><div><span class="gmail_quote">On 2/1/06, <b class="gmail_sendername">Frederic DANESI</b> <<a href="mailto:fred.danesi@netcourrier.com">fred.danesi@netcourrier.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<p style="margin-bottom: 12pt;"><font color="navy" face="Times New Roman" size="2"><span style="font-size: 10pt; color: navy;" lang="EN-GB">Dear,
</span></font></p>
<p style="margin-bottom: 12pt;"><font color="navy" face="Times New Roman" size="2"><span style="font-size: 10pt; color: navy;" lang="EN-GB">Thanks
for this helpful remark… it works now but finally that's not at all
what I am looking for …</span></font></p>
<p style="margin-bottom: 12pt;"><font color="navy" face="Times New Roman" size="2"><span style="font-size: 10pt; color: navy;" lang="EN-GB">In
fact, I would like to find the contour of several polygons … just like a
boolean operation of "union", so all points of all polygons have
the same scalar value. I was hoping that vtkContour would assume something like
this ….</span></font></p>
<p style="margin-bottom: 12pt;"><font color="navy" face="Times New Roman" size="2"><span style="font-size: 10pt; color: navy;" lang="EN-GB">Have
you any idea to do this ? … </span></font></p>
<p style="margin-bottom: 12pt;"><font color="navy" face="Times New Roman" size="2"><span style="font-size: 10pt; color: navy;" lang="EN-GB">Thanks,</span></font></p>
<p style="margin-bottom: 12pt;"><font color="navy" face="Times New Roman" size="2"><span style="font-size: 10pt; color: navy;" lang="EN-GB">Fred.</span></font></p><div><span class="e" id="q_109268e7c544df3c_1">
<p style="margin-bottom: 12pt;"><font color="navy" face="Times New Roman" size="2"><span style="font-size: 10pt; color: navy;" lang="EN-GB"> </span></font></p>
<p style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-GB">You're setting
the value of all 4 points to "1", and then taking a contour of
1. It doesn't intersect anywhere, so I </span>think it's working just
right.<br>
<br>
Change the scalars to:<br>
for (int i =0; i <4; i++) scalars->InsertNextValue(i); <br>
<br>
And then you'll have 4 different values.</font></p>
<div>
<p><span><font face="Times New Roman" size="3"><span style="font-size: 12pt;">On 2/1/06, <b><span style="font-weight: bold;">Frederic
DANESI</span></b> <<a href="mailto:fred.danesi@netcourrier.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">fred.danesi@netcourrier.com
</a>> wrote:</span></font></span></p>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Dear vtkusers,<br>
<br>
I am trying something that I believe quite simple, but without any success. <br>
<br>
I would like to build some vtkPolygons (2D) and then to use vtkContourFilter<br>
to obtain an isoline (which I assume to match with the boundary of all<br>
polygons together) ...<br>
<br>
Even with only one polygon, vtkContourFilter does not do anything <br>
(vtkContourFilter (09981DD8): Created: 0 points, 0 verts, 0 lines, 0<br>
triangles) ...<br>
<br>
I enclosed my code hereafter.<br>
<br>
I will really appreciate any idea, tips on what I missed or what I'm doing<br>
wrong, or any code example... <br>
<br>
Thanks,<br>
Fred.<br>
<br>
----<br>
<br>
vtkPolygon *polygon = vtkPolygon::New();<br>
<br>
polygon->GetPointIds()->SetNumberOfIds(4);<br>
polygon->GetPointIds()->SetId(0,0);<br>
polygon->GetPointIds()->SetId(1,1); <br>
polygon->GetPointIds()->SetId(2,2);<br>
polygon->GetPointIds()->SetId(3,3);<br>
<br>
polygon->GetPoints()->SetNumberOfPoints(4);<br>
polygon->GetPoints()->SetPoint(0, 0.0, 0.0, 0.0);<br>
polygon->GetPoints()->SetPoint(1, 10.0, 0.0, 0.0);<br>
polygon->GetPoints()->SetPoint(2, 10.0, 10.0, 0.0);<br>
polygon->GetPoints()->SetPoint(3, 0.0, 10.0, 0.0);<br>
<br>
vtkIntArray * scalars = vtkIntArray::New();<br>
scalars->Allocate(5000,10000); <br>
for (int i =0; i <4; i++) scalars->InsertNextValue(1);<br>
<br>
vtkPolyData * polygonPolyData = vtkPolyData::New();<br>
polygonPolyData->Allocate(1,1);<br>
polygonPolyData->InsertNextCell(polygon->GetCellType(), <br>
polygon->GetPointIds());<br>
polygonPolyData->SetPoints(polygon->GetPoints());<br>
polygonPolyData->GetPointData()->SetScalars(scalars);<br>
<br>
// mapping and rendering "polygonPolyData" ==> OK ... <br>
<br>
vtkContourFilter * flt = vtkContourFilter ::New();<br>
flt->SetInput((vtkDataSet *)output);<br>
flt->DebugOn();<br>
flt->SetValue(0,1);<br>
<br>
//+ mapping and rendering ==> vtkContourFilter
(09981DD8): Created: 0 <br>
points, 0 verts, 0 lines, 0 triangles ... empty ...<br>
<br>
--<br>
Responsable Département DINCCS<br>
(Département Ingénierie Numérique Conception Collaborative et Simulation)<br>
Pole de Haute Technologie<br>
08000 Charleville-Mézières <br>
Tél. 03.24.37.89.89<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
This is the private VTK discussion list.<br>
Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.vtk.org/mailman/listinfo/vtkusers</a></span></font></p>
</div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
<br clear="all">
<br>
-- <br>
Randall Hand<br>
Visualization Scientist, <br>
ERDC-MSRC Vicksburg, MS<br>
Homepage: <a href="http://www.yeraze.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.yeraze.com</a> </span></font></p>
</span></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Randall Hand<br>Visualization Scientist, <br>ERDC-MSRC Vicksburg, MS<br>Homepage: <a href="http://www.yeraze.com">http://www.yeraze.com</a>