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>
vtkPolyData *input = pointf->GetPolyDataInput();<br>
vtkPoints *newpts = vtkPoints::New();<br>
double *gcurv = new double[1];<br>
<br>
// compute curvatures<br>
vtkCurvatures *curv = vtkCurvatures::New();<br>
curv->SetInput(input);<br>
curv->SetCurvatureTypeToGaussian(); <br>
curv->Update();<br>
<br>
// array to store the curvature values<br>
vtkDoubleArray *dacurv = vtkDoubleArray::New();<br>
dacurv->SetNumberOfComponents(1);<br>
<br>
// iter stores the amount of iterations<br>
for (k=0; k<iter; k++) {<br>
<br>
//obtain the surface curvatures<br>
curv->Update();<br>
dacurv->DeepCopy(curv->GetOutput()->GetPointData()->GetScalars());<br>
<br>
for (i=0; i<nop; i++) {<br>
//get the point with id i, and store it in x<br>
input->GetPoint(i, x);<br>
cout<<"x_"<<i<<"=["<<x[0]<<","<<x[1]<<","<<x[2]<<"]"<<endl;<br>
//get the curvature<br>
dacurv->GetTuple(i, gcurv);<br>
cout<<"kappa_"<<i<<"="<<gcurv[0]<<endl;<br>
<br>
//update the point position<br>
x[0] = x[0] + gcurv[0];<br>
x[1] = x[1] + gcurv[0];<br>
x[2] = x[2] + gcurv[0];<br>
<br>
// store the new point in the array<br>
if (k==0) {<br>
newpts->InsertPoint(i, x[0], x[1], x[2]);<br>
} else {<br>
newpts->SetPoint(i, x[0], x[1], x[2]);<br>
}<br>
}<br>
<br>
// set the new points in the polydata<br>
input->SetPoints(newpts);<br>
curv->Update();<br>
}<br>
<br>
// set, finally, the resulting polydata <br>
pointf->GetPolyDataOutput()->CopyStructure(input);<br>
pointf->GetPolyDataOutput()->SetPoints(newpts);<br>
newpts->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> <<a href="mailto:domi@vision.ee.ethz.ch">domi@vision.ee.ethz.ch</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;">
call Update() from your vtkCurvature instance.<br>DS<br><br>Andrea del Pilar Rueda Olarte wrote:<br>> Hello,<br>><br>> I'm working in a program to deform 3D surfaces, but I have a little<br>> problem with the data attributes associated to the polydata.
<br>><br>> I use a vtkProgrammableFilter to modify the position of the mesh points,<br>> and I use a loop to iterate and update the point's position every time.<br>> The new position depends basically of the surface curvature in that
<br>> point, and to obtain the curvature values I use the class vtkCurvatures.<br>> I get the curvature of the initial surface, but after the first<br>> iteration, in the sucessive modifications of the surface, the curvature
<br>> values remains the same. I think I need to call some method to force the<br>> update of the curvature values associated to the polydata, but I don't<br>> know what to do with this.<br>><br>> Thanks for your help.
<br>><br>> Andrea Rueda<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">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">
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>