[vtkusers] vtkPoints from a triangular vtkPolyData
imho
imho at bephp.com
Thu Aug 14 08:32:51 EDT 2003
Hi all,
I'd like to use the vtkThinPlateSplineTransform, who needs vtkPoints
structures.
I've tried poly->getPoints() but it was empty, so here's what I've done:
models are vtkPolyData
TPSTarget and Origine vtkPoints
n1 = modelTarget->GetNumberOfPoints();
n2 = modelToMove->GetNumberOfPoints();
if (n1 < n2)
n=n1;
else
n=n2;
for (i=0; i<n; i++)
{
modelTarget->GetPoint(i,point);
TPSTarget->InsertNextPoint(point);
}
for (i=0; i<n; i++)
{
modelToMove->GetPoint(i,point);
TPSOrigine->InsertNextPoint(point);
}
TPSTr->SetSourceLandmarks(TPSOrigine);
TPSTr->SetTargetLandmarks(TPSTarget);
and then :
tf3 = vtkTransformPolyDataFilter::New();
tf3->SetTransform(TPSTr);
tf3->SetInput(poly);
tf3->Update();
return (tf3->GetOutput());
but it does nothing, my poly is the same on input and output., for the
same reason before I guess.
What can I try to have points from my polyData?
Thanks
More information about the vtkusers
mailing list