[vtkusers] How to draw a line between 2 points on surface

Michael Kozel michael.kozel at web.de
Thu Oct 4 06:31:22 EDT 2007


Hi,
I want to draw a line between 2 Points on a surface. In the attached file Headwith2Points.jpg you see the problem. I want to draw a line between the 2 given points on the surface of the headbone.

The source of the head is filtered like this in C++ with VTK5.0:
QString fileName = QString("kindPraeBone.vtk");
vtkPolyDataReader *reader = vtkPolyDataReader::New();
reader->SetFileName(fileName.toLatin1());

vtkPolyData* Input = vtkPolyData::New();
Input = reader->GetOutput();

vtkTriangleFilter* triangleGenerator = vtkTriangleFilter::New();
triangleGenerator->SetInput(Input);
	
vtkCleanPolyData* cleaner = vtkCleanPolyData::New();
cleaner->SetInput(triangleGenerator->GetOutput());

vtkPolyDataNormals* dataNormals = vtkPolyDataNormals::New();
dataNormals->SetInput(cleaner->GetOutput());
dataNormals->FlipNormalsOff();
dataNormals->SplittingOff();
dataNormals->ComputePointNormalsOn();
dataNormals->Update();

Output = dataNormals->GetOutput();

vtkPolyDataMapper* dataMapper =vtkPolyDataMapper::New();
dataMapper->SetInput(Output);
vtkActor *dataActor = vtkActor::New();
dataActor->SetMapper(dataMapper);
...

The 2 Points are given by double[3] WorldCoords. With a vtkPointLocater there is the chance to get the nearest Points. 
How can I draw the line on the surface.
Thanks for any idea!
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Headwith2Points.jpg
Type: image/jpeg
Size: 22011 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071004/cbc0ca79/attachment.jpg>


More information about the vtkusers mailing list