Hi Rong, <br><br><div class="gmail_quote">On 9 August 2012 14:27, Rong Xu <span dir="ltr">&lt;<a href="mailto:xurong1981@gmail.com" target="_blank">xurong1981@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi, Jana Sefcikova :<br><br>Thank you for your advice !<br><br>But I need to get the exact Gauss or Mean curvature. what do you think if I convert point cloud to a mesh, then use vtkCurvatures to get the curvature for each point ?<br>
</blockquote><div><br></div><div>It could work, but I do not know method to convert point cloud to polydata. Someone else could help you.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Also, I have another question. If I can get the curvatures, but how to get the curvature value for each point from vtkCurvatures ? Though I know some method like &quot;curv-&gt;GetOutput()-&gt;GetPointData()-&gt;GetScalars()&quot; to get the curvature values, but how can I know the coordinate (x, y, z) of that curvature value at the same time ?</blockquote>
<div><br></div><div><pre class="de1" style="padding:0px;border:0px none white;background-color:rgb(255,255,255);line-height:1.2em;font-size:10.399999618530273px;margin-top:0px;margin-bottom:0px;background-image:none;vertical-align:top">
 <span class="co1" style="color:rgb(102,102,102)">// Get the number of points in the polydata</span>
vtkIdType idNumPointsInFile <span class="sy1" style="color:rgb(0,0,128)">=</span> polydata<span class="sy2" style="color:rgb(0,0,64)">-</span><span class="sy1" style="color:rgb(0,0,128)">&gt;</span>GetNumberOfPoints<span class="br0" style="color:rgb(0,128,0)">(</span><span class="br0" style="color:rgb(0,128,0)">)</span><span class="sy4" style="color:rgb(0,128,128)">;</span></pre>
<pre class="de1" style="padding:0px;border:0px none white;background-color:rgb(255,255,255);line-height:1.2em;font-size:10.399999618530273px;margin-top:0px;margin-bottom:0px;background-image:none;vertical-align:top"><span class="sy4" style="color:rgb(0,128,128)"><br>
</span></pre></div><pre class="de1" style="padding:0px;border:0px none white;background-color:rgb(255,255,255);line-height:1.2em;font-size:10.399999618530273px;margin-top:0px;margin-bottom:0px;background-image:none;vertical-align:top">
vtkSmartPointer<span class="sy1" style="color:rgb(0,0,128)">&lt;</span>vtkDoubleArray<span class="sy1" style="color:rgb(0,0,128)">&gt;</span> arrMean <span class="sy1" style="color:rgb(0,0,128)">=</span> 
    vtkDoubleArray<span class="sy4" style="color:rgb(0,128,128)">::</span><span class="me2" style="color:rgb(0,119,136)">SafeDownCast</span><span class="br0" style="color:rgb(0,128,0)">(</span>polydata<span class="sy2" style="color:rgb(0,0,64)">-</span><span class="sy1" style="color:rgb(0,0,128)">&gt;</span>GetPointData<span class="br0" style="color:rgb(0,128,0)">(</span><span class="br0" style="color:rgb(0,128,0)">)</span><span class="sy2" style="color:rgb(0,0,64)">-</span><span class="sy1" style="color:rgb(0,0,128)">&gt;</span>GetArray<span class="br0" style="color:rgb(0,128,0)">(</span><span class="st0" style="color:rgb(255,0,0)">&quot;Mean_Curvature&quot;</span><span class="br0" style="color:rgb(0,128,0)">)</span><span class="br0" style="color:rgb(0,128,0)">)</span><span class="sy4" style="color:rgb(0,128,128)">; </span></pre>
<div><pre class="de1" style="padding:0px;border:0px none white;background-color:rgb(255,255,255);line-height:1.2em;font-size:10.399999618530273px;margin-top:0px;margin-bottom:0px;background-image:none;vertical-align:top">
vtkSmartPointer<span class="sy1" style="color:rgb(0,0,128)">&lt;</span>vtkDoubleArray<span class="sy1" style="color:rgb(0,0,128)">&gt;</span> arrGauss <span class="sy1" style="color:rgb(0,0,128)">=</span> 
    vtkDoubleArray<span class="sy4" style="color:rgb(0,128,128)">::</span><span class="me2" style="color:rgb(0,119,136)">SafeDownCast</span><span class="br0" style="color:rgb(0,128,0)">(</span>polydata<span class="sy2" style="color:rgb(0,0,64)">-</span><span class="sy1" style="color:rgb(0,0,128)">&gt;</span>GetPointData<span class="br0" style="color:rgb(0,128,0)">(</span><span class="br0" style="color:rgb(0,128,0)">)</span><span class="sy2" style="color:rgb(0,0,64)">-</span><span class="sy1" style="color:rgb(0,0,128)">&gt;</span>GetArray<span class="br0" style="color:rgb(0,128,0)">(</span><span class="st0" style="color:rgb(255,0,0)">&quot;Gauss_Curvature&quot;</span><span class="br0" style="color:rgb(0,128,0)">)</span><span class="br0" style="color:rgb(0,128,0)">)</span><span class="sy4" style="color:rgb(0,128,128)">; </span></pre>
</div><pre class="de1" style="padding:0px;border:0px none white;background-color:rgb(255,255,255);line-height:1.2em;font-size:10.399999618530273px;margin-top:0px;margin-bottom:0px;background-image:none;vertical-align:top">
 </pre><pre class="de1" style="padding:0px;border:0px none white;background-color:rgb(255,255,255);line-height:1.2em;font-size:10.399999618530273px;margin-top:0px;margin-bottom:0px;background-image:none;vertical-align:top">
<span class="kw1" style="color:rgb(0,0,255)">for</span><span class="br0" style="color:rgb(0,128,0)">(</span><span class="kw4" style="color:rgb(0,0,255)">int</span> i <span class="sy1" style="color:rgb(0,0,128)">=</span> <span class="nu0" style="color:rgb(0,0,221)">0</span><span class="sy4" style="color:rgb(0,128,128)">;</span> i <span class="sy1" style="color:rgb(0,0,128)">&lt;</span> idNumPointsInFile<span class="sy4" style="color:rgb(0,128,128)">;</span> i<span class="sy2" style="color:rgb(0,0,64)">++</span><span class="br0" style="color:rgb(0,128,0)">)</span>
 <span class="br0" style="color:rgb(0,128,0)">{</span>
   <span class="kw4" style="color:rgb(0,0,255)">double</span> mean, gauss<span class="sy4" style="color:rgb(0,128,128)">;</span></pre><pre class="de1" style="padding:0px;border:0px none white;background-color:rgb(255,255,255);line-height:1.2em;font-size:10.399999618530273px;margin-top:0px;margin-bottom:0px;background-image:none;vertical-align:top">
<span class="sy4" style="color:rgb(0,128,128)"><span style="font-size:10.399999618530273px;line-height:1.2em">   </span><span class="kw4" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,0,255)">double</span><span style="font-size:10.399999618530273px;line-height:1.2em"> coords[3];</span></span></pre>
<div><span style="background-color:rgb(255,255,255);font-size:10.399999618530273px;line-height:1.2em">      mean </span><span class="sy1" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,0,128)">=</span><span style="background-color:rgb(255,255,255);font-size:10.399999618530273px;line-height:1.2em"> arrMean</span><span class="sy2" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,0,64)">-</span><span class="sy1" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,0,128)">&gt;</span><span style="background-color:rgb(255,255,255);font-size:10.399999618530273px;line-height:1.2em">GetValue</span><span class="br0" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,128,0)">(</span><span style="background-color:rgb(255,255,255);font-size:10.399999618530273px;line-height:1.2em">i</span><span class="br0" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,128,0)">)</span><span class="sy4" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,128,128)">;</span></div>
<div><span class="sy4" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,128,128)">    </span><span style="background-color:rgb(255,255,255);font-size:10.399999618530273px;line-height:1.2em">  gauss</span><span class="sy1" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,0,128)">=</span><span style="background-color:rgb(255,255,255);font-size:10.399999618530273px;line-height:1.2em"> arrGauss</span><span class="sy2" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,0,64)">-</span><span class="sy1" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,0,128)">&gt;</span><span style="background-color:rgb(255,255,255);font-size:10.399999618530273px;line-height:1.2em">GetValue</span><span class="br0" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,128,0)">(</span><span style="background-color:rgb(255,255,255);font-size:10.399999618530273px;line-height:1.2em">i</span><span class="br0" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,128,0)">)</span><span class="sy4" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,128,128)">;</span></div>
<div><span class="sy4" style="font-size:10.399999618530273px;line-height:1.2em"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-size:10.399999618530273px;line-height:1.2em">      polydata-&gt;</span><span style="background-color:rgb(255,255,255);font-size:10.399999618530273px;line-height:1.2em"><font color="#000080">GetPoint(i,coords)</font></span><span class="sy4" style="color:rgb(0,128,128);font-size:10.399999618530273px;line-height:1.2em">;</span>
</span></div><div> <span style="background-color:rgb(255,255,255);font-size:10.399999618530273px;line-height:1.2em"> </span><span class="br0" style="font-size:10.399999618530273px;line-height:1.2em;color:rgb(0,128,0)">}</span></div>
</div>