[vtkusers] ThinPlatespline issue
Eric Barn
ebarn100 at gmail.com
Mon Jan 25 22:41:02 EST 2010
I mailed a post but looks like it dod not make it to the list.
My goal is to create a surface with nx by ny grid blocks using some x, y, z
data. I am trying to use the ThinPlateSpline. I looked thru the Tcl code (ie
in hybrid floder) but I still am unable to display my results.
It will be very helpful if someone can point me to some other existing code.
Thanks.
-Eric
On Sun, Jan 24, 2010 at 8:49 PM, Eric Barn <ebarn100 at gmail.com> wrote:
> All,
> I am trying to display some points/Grid using ThinPlatespline as in the
> code below. But I donot see the map in the viewer. I see the same map if I
> use delauny2D.
>
> I really appreciate your help on it.
>
> -Eric
>
> // Generate a 10 x 10 grid of points
> vtkPoints *points = vtkPoints::New();
> vtkPoints *pointsT = vtkPoints::New();
> for(unsigned int x = 0; x < 10; x++)
> {
> for(unsigned int y = 0; y < 10; y++)
> {
> points->InsertNextPoint(x + vtkMath::Random(-.250, 0.25),
> y + vtkMath::Random(-.250, 0.25),
> vtkMath::Random(0.0,.50));// 0);
> }
> }
>
> vtkPolyData *aPolyData = vtkPolyData::New();
> aPolyData->SetPoints(points);
> vtkThinPlateSplineTransform* tpst = vtkThinPlateSplineTransform::New();
> tpst->SetSourceLandmarks(points);
> tpst->SetBasisToR();
> vtkGeneralTransform* tpstconcat = vtkGeneralTransform::New();
> tpstconcat->SetInput(tpst);
> tpstconcat->Concatenate(tpst->GetInverse());
> tpstconcat->Concatenate(tpst);
>
> vtkTransformPolyDataFilter *transformer=
> vtkTransformPolyDataFilter::New();
> transformer->SetInput(aPolyData);
> transformer->SetTransform(tpstconcat);//tpst);
>
> // vtkPolyDataMapper *mapperPoly = vtkPolyDataMapper::New();
> vtkDataSetMapper *mapperPoly = vtkDataSetMapper::New();
> mapperPoly->SetInput(transformer->GetOutput());//outputPolyData);
>
> surfaceActor = vtkActor::New();
> surfaceActor->SetMapper(mapperPoly);
> vtkWindow1->GetRenderer()->AddActor(surfaceActor);
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100125/853cdbee/attachment.htm>
More information about the vtkusers
mailing list