Hello Dominik,<br>
<br>
Thanks for your suggestion, but it doesn't work.<br>
<br>
Maybe if I put some code parts you can help me...<br>
<br>
//********** begin code part **********//<br>
// mapping is the function to use with the vtkProgrammableFilter<br>
// pointf is the vtkProgrammableFilter instance<br>
<br>
void mapping (void * p) {<br>
&nbsp;&nbsp;&nbsp; vtkPolyData *input = pointf-&gt;GetPolyDataInput();<br>
&nbsp;&nbsp;&nbsp; vtkPoints *newpts = vtkPoints::New();<br>
&nbsp;&nbsp;&nbsp; double *gcurv = new double[1];<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; // compute curvatures<br>
&nbsp;&nbsp;&nbsp; vtkCurvatures *curv = vtkCurvatures::New();<br>
&nbsp;&nbsp;&nbsp; curv-&gt;SetInput(input);<br>
&nbsp;&nbsp;&nbsp; curv-&gt;SetCurvatureTypeToGaussian();&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; curv-&gt;Update();<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; // array to store the curvature values<br>
&nbsp;&nbsp;&nbsp; vtkDoubleArray *dacurv = vtkDoubleArray::New();<br>
&nbsp;&nbsp;&nbsp; dacurv-&gt;SetNumberOfComponents(1);<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; // iter stores the amount of iterations<br>
&nbsp;&nbsp;&nbsp; for (k=0; k&lt;iter; k++) {<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //obtain the surface curvatures<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; curv-&gt;Update();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dacurv-&gt;DeepCopy(curv-&gt;GetOutput()-&gt;GetPointData()-&gt;GetScalars());<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (i=0; i&lt;nop; i++) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //get the point with id i, and store it in x<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; input-&gt;GetPoint(i, x);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
cout&lt;&lt;&quot;x_&quot;&lt;&lt;i&lt;&lt;&quot;=[&quot;&lt;&lt;x[0]&lt;&lt;&quot;,&quot;&lt;&lt;x[1]&lt;&lt;&quot;,&quot;&lt;&lt;x[2]&lt;&lt;&quot;]&quot;&lt;&lt;endl;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //get the curvature<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dacurv-&gt;GetTuple(i, gcurv);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cout&lt;&lt;&quot;kappa_&quot;&lt;&lt;i&lt;&lt;&quot;=&quot;&lt;&lt;gcurv[0]&lt;&lt;endl;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //update the point position<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; x[0] = x[0] + gcurv[0];<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; x[1] = x[1] + gcurv[0];<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; x[2] = x[2] + gcurv[0];<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // store the new point in the array<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (k==0) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; newpts-&gt;InsertPoint(i, x[0], x[1], x[2]);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; newpts-&gt;SetPoint(i, x[0], x[1], x[2]);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // set the new points in the polydata<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; input-&gt;SetPoints(newpts);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; curv-&gt;Update();<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; // set, finally, the resulting polydata <br>
&nbsp;&nbsp;&nbsp; pointf-&gt;GetPolyDataOutput()-&gt;CopyStructure(input);<br>
&nbsp;&nbsp;&nbsp; pointf-&gt;GetPolyDataOutput()-&gt;SetPoints(newpts);<br>
&nbsp;&nbsp;&nbsp; newpts-&gt;Delete();<br>
}<br>
//********** end code part **********//<br>
<br>
When I execute the code with two iterations, and compare the point
positions and the curvature values in both iterations, the point
positions has change, but the curvatures remains the same.<br>
<br>
Thanks for your help.<br>
<br>
Andrea Rueda<br>
<br><br><div><span class="gmail_quote">On 9/21/06, <b class="gmail_sendername">Dominik Szczerba</b> &lt;<a href="mailto:domi@vision.ee.ethz.ch">domi@vision.ee.ethz.ch</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
call Update() from your vtkCurvature instance.<br>DS<br><br>Andrea del Pilar Rueda Olarte wrote:<br>&gt; Hello,<br>&gt;<br>&gt; I'm working in a program to deform 3D surfaces, but I have a little<br>&gt; problem with the data attributes associated to the polydata.
<br>&gt;<br>&gt; I use a vtkProgrammableFilter to modify the position of the mesh points,<br>&gt; and I use a loop to iterate and update the point's position every time.<br>&gt; The new position depends basically of the surface curvature in that
<br>&gt; point, and to obtain the curvature values I use the class vtkCurvatures.<br>&gt; I get the curvature of the initial surface, but after the first<br>&gt; iteration, in the sucessive modifications of the surface, the curvature
<br>&gt; values remains the same. I think I need to call some method to force the<br>&gt; update of the curvature values associated to the polydata, but I don't<br>&gt; know what to do with this.<br>&gt;<br>&gt; Thanks for your help.
<br>&gt;<br>&gt; Andrea Rueda<br>&gt;<br>&gt;<br>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt; _______________________________________________<br>&gt; This is the private VTK discussion list.
<br>&gt; Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers">
http://www.vtk.org/mailman/listinfo/vtkusers</a><br><br>--<br>Dominik Szczerba, Ph.D.<br>Computer Vision Lab CH-8092 Zurich<br><a href="http://www.vision.ee.ethz.ch/~domi">http://www.vision.ee.ethz.ch/~domi</a><br></blockquote>
</div><br>