<div dir="ltr">Hi, <br><br>Your polygon loop is non-planar.<div><img src="cid:ii_j1itbiq12_15b700cc9d608067" width="280" height="167" style="margin-right: 0px;"><br><br></div><div><div>Howerver, the triangulate method used by vtkPolygon assumes that polygon points lie in a plane. I recommend to use vtkCylinderSource or vtkStructuredGrid to represent the side of surface of a cylinder.<br></div><div><br>Thanks,<br>yoshimi</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-04-14 0:38 GMT+09:00 Rakesh Patil <span dir="ltr"><<a href="mailto:rakesh.p@tataelxsi.co.in" target="_blank">rakesh.p@tataelxsi.co.in</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div id="m_6263524568884259717divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif" dir="ltr">
<p>Hi,</p>
<p><br>
</p>
<p>This question seems to be simple, but I am not able to get any output for this. I am not able to understand what is happening in this case:</p>
<p><br>
</p>
<p></p>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#800080">vtkSmartPointer</span><<span style="color:#800080">vtkPoints</span>><span style="color:#c0c0c0"> </span>tpoints<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span><span style="color:#800080">vtkSmartPointer</span><<span style="color:#800080">vtkPoints</span>>::<wbr>New();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#800080">vtkSmartPointer</span><<span style="color:#800080">vtkPolygon</span>><span style="color:#c0c0c0"> </span>poly<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span><span style="color:#800080">vtkSmartPointer</span><<span style="color:#800080">vtkPolygon</span>>::<wbr>New();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#800080">vtkSmartPointer</span><<span style="color:#800080">vtkCellArray</span>><span style="color:#c0c0c0"> </span>carr<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span><span style="color:#800080">vtkSmartPointer</span><<span style="color:#800080">vtkCellArray</span>>:<wbr>:New();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><pre style="font-size:16px;margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,128)">vtkSmartPointer</span><<span style="color:rgb(128,0,128)">vtkPolyData</span>><span style="color:rgb(192,192,192)"> </span>polyData<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">vtkSmartPointer</span><<span style="color:rgb(128,0,128)">vtkPolyData</span>>::<wbr>New();</pre></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span><span style="color:#000080">4.39116</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.39117</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">4.5</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span><span style="color:#000080">4.39116</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.39117</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">3</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span><span style="color:#000080">4.39116</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.39117</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">1.5</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span><span style="color:#000080">4.39116</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.39117</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#008000"></span></pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span><span style="color:#000080">4.08748</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.87967</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span><span style="color:#000080">3.05391</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">3.95899</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span><span style="color:#000080">1.74755</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">4.68466</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span><span style="color:#000080">0.28509</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">4.99187</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">1.20284</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">4.85316</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.58332</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">4.28094</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">3.73305</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">3.32631</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">4.54931</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.07456</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">4.95919</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">0.637487</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">4.92609</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0.856528</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">4.45295</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">2.27403</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">3.58205</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">3.4884</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.39117</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">4.39116</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#008000"></span></pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.39117</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">4.39116</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">1.5</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.39117</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">4.39116</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">3</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.39117</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">4.39116</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">4.5</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.39117</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">4.39116</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">6</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#008000"></span></pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">3.58205</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">3.4884</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">6</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">4.45295</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">2.27403</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">6</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#c0c0c0"> </span>-<span style="color:#000080">4.92609</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0.856528</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">6</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(-<span style="color:#000080">4.95919</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">0.637487</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">6</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(-<span style="color:#000080">4.54931</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.07456</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">6</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(-<span style="color:#000080">3.73305</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">3.32631</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">6</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(-<span style="color:#000080">2.58332</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">4.28094</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">6</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(-<span style="color:#000080">1.20284</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">4.85316</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">6</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#000080">0.28509</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">4.99187</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">6</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#000080">1.74755</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">4.68466</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">6</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#000080">3.05391</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">3.95899</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">6</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#000080">4.08748</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.87967</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">6</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px">poly->GetPointIds()-><wbr>InsertNextId(tpoints-><wbr>InsertNextPoint(<span style="color:#000080">4.39116</span>,<span style="color:#c0c0c0"> </span>-<span style="color:#000080">2.39117</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">6</span>));</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#008000"></span></pre>
<pre style="margin-top:0px;margin-bottom:0px">carr->InsertNextCell(poly);</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>polyData-><span style="font-style:italic">SetPoints</span>(tpoints);</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>polyData->SetPolys(carr);</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span><span style="color:#800080">vtkSmartPointer</span><<span style="color:#800080">vtkTriangleFil<wbr>ter</span>><span style="color:#c0c0c0"> </span>tfilter<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span><span style="color:#800080">vtkSmartPointer</span><<span style="color:#800080">vtkTriangleFil<wbr>ter</span>>::New();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>tfilter->SetInputData(<wbr>polyData);</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>tfilter-><span style="font-style:italic">Update</span>();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span><span style="color:#800080">vtkSmartPointer</span><<span style="color:#800080">vtkPolyDataMap<wbr>per</span>><span style="color:#c0c0c0"> </span>pmapper<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span><span style="color:#800080">vtkSmartPointer</span><<span style="color:#800080">vtkPolyDataMap<wbr>per</span>>::New();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>pmapper->SetInputConnection(<wbr>tfilter->GetOutputPort());</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#008000"></span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span><span style="color:#800080">vtkSmartPointer</span><<span style="color:#800080">vtkActor</span>><span style="color:#c0c0c0"> </span>actor<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span><span style="color:#800080">vtkSmartPointer</span><<span style="color:#800080">vtkActor</span>>::<wbr>New();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>actor-><span style="font-style:italic">SetMapper</span>(pmapper);</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#008000"></span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>actor->GetProperty()-><wbr>SetRepresentationToSurface();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>actor->GetProperty()-><span style="font-style:italic">EdgeVisi<wbr>bilityOn</span>();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>actor->GetProperty()-><span style="font-style:italic">SetEdgeC<wbr>olor</span>(<span style="color:#000080">1.0</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0.0</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">0.0</span>);</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#008000"></span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>renderer->AddActor(actor);</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0"> </span>renderer->ResetCamera();</pre>
<br>
<p></p>
<p><br>
</p>
<p>I am not able to view the output if I use vtkTriangleFilter. I have attached two screenshots. One is to show how the expected output should come. Another is the vtk's output without applying vtkTriangleFilter. How do I get the curved surfaces based on the
above geometry (points)?</p>
<p><br>
</p>
<p>Am I missing anything there?</p>
<p><br>
</p>
<p><br>
</p>
<div id="m_6263524568884259717Signature">
<div id="m_6263524568884259717divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Thanks & Regards</p><span class="HOEnZb"><font color="#888888">
<p>Rakesh Patil</p>
<p><br>
</p>
<div style="color:rgb(33,33,33);font-size:15px;margin:0px"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font size="2" color="gray"><span lang="en-IN" style="font-size:10pt"></span></font></span></font></div>
<p></p>
<p></p>
</font></span></div>
</div>
</div>
</div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div></div>