[vtkusers] Find coordinates of points inside vtkPolyData Model

David Doria daviddoria at gmail.com
Sun Nov 21 18:38:22 EST 2010


On Sun, Nov 21, 2010 at 6:29 PM, Sam Istephan <sistephan at gmail.com> wrote:
> I can't get the array of points that are inside, here is my pipeline:
>
>
> vtkSelectEnclosedPoints vtkModelRegion = new vtkSelectEnclosedPoints();
> //vtkModelRegion.SetInput(model);
> vtkModelRegion.Initialize(model);
> vtkModelRegion.SetCheckSurface(1);
> //vtkModelRegion.SetSurface(model);
> vtkModelRegion.Update();
>
>  vtkDataArray insideArray =
> vtkModelRegion.GetOutput().GetPointData().GetArray("SelectedPoints");
> //Could not create class vtkDataSet from null native pointer.
>
> In fact, event this throws that error:  vtkDataSet ds =
> vtkModelRegion.GetOutput();

(Please keep the discussion on the list so everyone can help and benefit)

Which language are you using?

vtkSelectEnclosedPoints vtkModelRegion = new vtkSelectEnclosedPoints();

is not valid syntax in c++ as far as I know.

Also, in the example I have SafeDownCasted the array from the
vtkDataSet to a vtkDataArray, where you have simply tried to assign
one to the other:

vtkDataArray* insideArray =
vtkDataArray::SafeDownCast(selectEnclosedPoints->GetOutput()->GetPointData()->GetArray("SelectedPoints"));

vs

vtkDataArray insideArray =
vtkModelRegion.GetOutput().GetPointData().GetArray("SelectedPoints");

David



More information about the vtkusers mailing list