<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" 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;"><!--StartFragment--><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>>::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>>::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>>::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>>::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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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()->InsertNextId(tpoints->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;">vtkTriangleFilter</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;">vtkTriangleFilter</span>>::New();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;"> </span>tfilter->SetInputData(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;">vtkPolyDataMapper</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;">vtkPolyDataMapper</span>>::New();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;"> </span>pmapper->SetInputConnection(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>>::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()->SetRepresentationToSurface();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;"> </span>actor->GetProperty()-><span style="font-style: italic;">EdgeVisibilityOn</span>();</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" color:#c0c0c0;"> </span>actor->GetProperty()-><span style="font-style: italic;">SetEdgeColor</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();<!--EndFragment--></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="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Thanks & Regards</p>
<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>
</div>
</div>
</div>
</body>
</html>