No subject
Fri May 8 15:29:31 EDT 2009
of polys in the polydata. Try adding to vertices instead.
What I usually do for point clouds is something like this:
vtkPolyData * polyData = vtkPolyData::New();
vtkPoints * points = vtkPoints::New();
polyData->SetPoints(points);
polyData->Allocate();
...
vtkIdType id = points->InsertNextPoint(myPt);
polyData->InsertNextCell(VTK_VERTEX, 1, &id);
This usually works quite decently...
Regards,
Shash
--000e0cd14ed85044b4046c6f9ebd
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,<br><br><div class=3D"gmail_quote">On Wed, Jun 10, 2009 at 11:54 AM, nju=
zg <span dir=3D"ltr"><<a href=3D"mailto:guangz at u.washington.edu">guangz@=
u.washington.edu</a>></span> wrote:<br><blockquote class=3D"gmail_quote"=
style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.=
8ex; padding-left: 1ex;">
<br></blockquote><blockquote class=3D"gmail_quote" style=3D"border-left: 1p=
x solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">=
...<br>
=A0vtkCellArray* pts =3D vtkCellArray::New();<br>
// pts->InsertNextCell(1);<br>
=A0for(int i=3D0; i<xcoord_array.size();++i)<br>
=A0 =A0 =A0 =A0 =A0pts->InsertCellPoint(i);<br>
...<br>
vtkPolyData *polydata=3DvtkPolyData::New();<br>
=A0 polydata->SetPoints(points);<br>
=A0 polydata->SetPolys(pts);<br>
=A0 polydata->GetPointData()->SetScalars(scalars);</blockquote><div>=
<br><br>From the above lines, it looks like you're trying to add the po=
ints to a set of polys in the polydata. Try adding to vertices instead.<br>
<br>What I usually do for point clouds is something like this:<br><br>vtkPo=
lyData * polyData =3D vtkPolyData::New();<br>vtkPoints * points =3D vtkPoin=
ts::New();<br>polyData->SetPoints(points);<br>polyData->Allocate();<b=
r>
<br>...<br><br>vtkIdType id =3D points->InsertNextPoint(myPt);<br>polyDa=
ta->InsertNextCell(VTK_VERTEX, 1, &id);<br><br>This usually works qu=
ite decently...<br><br>Regards,<br>Shash<br></div></div>
--000e0cd14ed85044b4046c6f9ebd--
More information about the vtkusers
mailing list