<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi,<br>
<br>
I have a Polydata object consisting of e.g. 8 points. I'd like to
get more points on the object.<br>
I tried it with a vtkPolyDataPointSampler.<br>
This works fine with a sphere but it crashes with vtkPolyData.<br>
<br>
Has anyone an idea what the problem might be? Or any alternative
idea?<br>
Thanks in advance!<br>
<br>
Code:<br>
<font color="#009900">//vtkSmartPointer<vtkSphereSource>
sphereSource = vtkSmartPointer<vtkSphereSource>::New();<br>
// sphereSource->Update();</font><br>
vtkSmartPointer<vtkPolyData> data =
vtkSmartPointer<vtkPolyData>::New();<br>
data->ShallowCopy(stlActor->GetMapper()->GetInputAsDataSet());<br>
data->Update();<br>
vtkSmartPointer<vtkPolyDataPointSampler> pointSampler =
vtkSmartPointer<vtkPolyDataPointSampler>::New();<br>
pointSampler->SetDistance(.1);<br>
pointSampler->SetInputConnection(data->GetProducerPort());<br>
<font color="#009900">
/*pointSampler->SetInputConnection(sphereSource->GetOutputPort());*/</font><br>
pointSampler->Update(); <font color="#ff0000">//It
crashes here</font><br>
int numpoints=pointSampler->GetOutput()->GetNumberOfPoints();<br>
</body>
</html>