[vtkusers] vtkPolyData to be used with vtkImageStencil.
Anja Ende
anja.ende at googlemail.com
Wed Oct 25 10:11:37 EDT 2006
Ok, another step closer.
First off, something very bizarre happens when I close the loop in the input
points.
So, the first time off, I tried without closing the loop as follows:
float pts[3][3] = {{-49.2188, -19.6875, zOffset},
{42.6542, 58.125, zOffset},
{57.6562, -0.9375, zOffset},
vtkFloatArray* pcoords = vtkFloatArray::New();
pcoords->SetNumberOfComponents(3);
pcoords->SetNumberOfTuples(4);
for (int i=0; i<3; i++)
{
pcoords->SetTuple(i, pts[i]);
}
// Create vtkPoints and assign pcoords as the internal data array.
vtkPoints* points = vtkPoints::New();
points->SetData(pcoords);
vtkPolyData* polydata = vtkPolyData::New();
polydata->SetPoints(points);
vtkCellArray* strips = vtkCellArray::New();
strips->InsertNextCell(3);
strips->InsertCellPoint(0);
strips->InsertCellPoint(1);
strips->InsertCellPoint(2);
polydata->SetStrips(strips);
I am attaching a screenshot here that displays what happens. At least the
triangle part looks ok!
Now, when I close the loop, the output goes completely bonkers!
Here is a screenshot of the output with the same points when the loop is
closed.
As you can see from the points, it is a simple triable with no cross overs
or anything but it seems to mess up the shape completely...
Any idea what is happening here?
Cheers,
Anja
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061025/36fb186b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen shot without closed loop.png
Type: image/png
Size: 9719 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061025/36fb186b/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen shot with closed loop.png
Type: image/png
Size: 7982 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061025/36fb186b/attachment-0001.png>
More information about the vtkusers
mailing list