[vtkusers] 3D plot of multiple lines between 2 known points

yadin Bocuma Rivas conra2004 at yahoo.com
Tue Aug 21 12:17:08 EDT 2007


Skipped content of type multipart/alternative-------------- next part --------------
import wx
import vtk
from wx.wxVTKRendererWindow.import *
start = (x1[i],y1[i],z1[i]) #those r the end1 point that i create (50 points)
                            #start = (0,0,1)
                            #start =(0,o,0.025)
                            #.....

end = (x2[i],y2[i],z2[i])   #those are the line or arrow end2 points that i create(50 points)
print start, end


app2 = wx.App()             # i am using wx, instead of iren

# create the widget
frame = wx.Frame(None, title="magnetic field strength", size=wxSize(400,400))
widget = wxVTKRenderWindow(frame, -1)

ren = vtkRenderer()
widget.GetRenderWindow().AddRenderer(ren)

line = vtkLineSource()  # i create a line and say it must get its coordinates from the previous
line.SetPoint1(start)   #previous created start and end 
line.SetPoint2(end)    #why does it take only one 

linesMapper = vtkPolyDataMapper()
linesMapper.SetInput(line.GetOutput())

linesActor = vtkActor()
linesActor.SetMapper(linesMapper)

ren.AddActor(linesActor)

# show the window

frame.Show()

app2.MainLoop()



More information about the vtkusers mailing list