[vtkusers] Re: How to get a line on surface

Raashid Baig raashid.b at rediffmail.com
Tue Oct 2 00:14:41 EDT 2007


>>I have a more or less sphere-like surface and want to have a direct >>link on this surface from a given start- and endpoint on this surface.

If your surface is generated from vtkSphereSource, you can find the points of sphere using:

cs = vtk.vtkSphereSource()
cs.Update()
ps = cs.GetOutput()
points = ps.GetPoints()

Then you can write a simple function which will calculate the distance between your point and points on the sphere. You can now identify the point nearest to your given point. Once you have the 2 points you can draw a line between them. 

If you yourself have created the surface you can always do the same logic easily.

>>I hope you understand the problem and may give me some ideas how to >>show the shortest link on the surface between the to points.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071002/efab95d9/attachment.htm>


More information about the vtkusers mailing list