[vtkusers] Create a curvilinear curve
toulgen
toulgen at gmail.com
Fri Oct 23 11:22:35 EDT 2009
Hi,
I have n points:
----------------------------------------------------------------------------
-------------------
vtkPoints* temp_pts = vtkPoints::New(); // XYZ coords
temp_pts->InsertPoint(0, 20,20,20);
temp_pts->InsertPoint(1, 20,512,20);
temp_pts->InsertPoint(2, 512,512,20);
temp_pts->InsertPoint(3, 512,20,20);
temp_pts->InsertPoint(4, 20,20,20);
temp_pts->InsertPoint(0, 20,20,300);
temp_pts->InsertPoint(1, 20,512,300);
temp_pts->InsertPoint(2, 512,512,300);
temp_pts->InsertPoint(3, 512,20,300);
----------------------------------------------------------------------------
-------------------
With the following code I create a polyline:
----------------------------------------------------------------------------
-------------------
// Create the polyline.
vtkCellArray *lines = vtkCellArray::New();
int numPoints = temp_pts->GetNumberOfPoints();
lines->InsertNextCell(numPoints);
for (int j = 0; j < numPoints; j++)
lines->InsertCellPoint(j);
vtkPolyData *profileData = vtkPolyData::New();
profileData->SetPoints((vtkPoints *)(temp_pts));
profileData->SetLines(lines);
//profileData->GetPointData()->SetScalars(scalars);
profileData->BuildLinks();
----------------------------------------------------------------------------
-------------------
I want to create a curvilinear curve with my n points.
It is possible?
Thx.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091023/1998f46e/attachment.htm>
More information about the vtkusers
mailing list