[vtkusers] vtkPoints from a triangular vtkPolyData

imho imho at bephp.com
Thu Aug 14 08:47:33 EDT 2003


Hi Tim,
the polydatas here are from a call to CopyStructure from a polydata who 
is the output of a filter, but updated.
Can it be the problem?

Thanks

imho


Tim Hutton wrote:

> Hi imho,
>
> If your polydata is the output of a filter (like vtkTriangleFilter) 
> then you will need to call Update on it in order to use its output, 
> else GetNumberOfPoints will return zero and GetPoint won't work.
>
> If you've made your own polydata then there must be something wrong 
> with how the points were assigned. Perhaps if you send us your code 
> for that bit we might be able to help.
>
> Also worth checking that the in and out points are different...
>
> Tim
>
> At 14:32 14/08/2003 +0200, imho wrote:
>
>> 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
>>
>>
>>
>> _______________________________________________
>> This is the private VTK discussion list. Please keep messages 
>> on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
>




More information about the vtkusers mailing list